Exploratory Analysis of NO2 and COVID-19 variables.
Univariate analysis of world NO2 concentrations.
#Statistics on world NO2 concentrations.
covid.NO2.df %>%
summarize(variable = "NO2_Concentration", mean_NO2 = mean(NO2_Concentration, na.rm = T), st_dev_cty = sd(NO2_Concentration, na.rm = T)) %>%
pander
| NO2_Concentration |
1.692e-05 |
1.103e-05 |
covid.NO2.df %>%
summarize(variable = "NO2_Concentration",
q0.2 = quantile(NO2_Concentration, 0.2, na.rm = T),
q0.4 = quantile(NO2_Concentration, 0.4, na.rm = T),
q0.6 = quantile(NO2_Concentration, 0.6, na.rm = T),
q0.8 = quantile(NO2_Concentration, 0.8, na.rm = T)) %>%
pander
| NO2_Concentration |
8.389e-06 |
1.204e-05 |
1.728e-05 |
2.352e-05 |
#Histogram of NO2 concentrations.
covid.NO2.df %>%
ggplot(aes(NO2_Concentration)) +
geom_histogram(color = "black",fill = "grey") +
geom_vline(xintercept = mean(covid.NO2.df$NO2_Concentration), lwd = 2) +
labs(title = "Distribution of Tropospheric NO2",
x = "NO2 Concentration (mol/m^2)",
y = "Number of Countries") +
theme_minimal() +
scale_x_continuous(breaks = seq(0,8E-5,0.5E-5)) +
theme(axis.text.x = element_text(angle = 45,hjust=1))

Univariate analysis of world COVID statistics.
#Statistics on world COVID case statistics.
covid.NO2.df %>%
summarize(variable = "totcases.mil", mean_cases = mean(totcases.mil, na.rm = T), st_dev_cty = sd(totcases, na.rm = T)) %>%
pander
| totcases.mil |
35928 |
3611805 |
covid.NO2.df %>%
summarize(variable = "totcases.mil",
q0.2 = quantile(totcases.mil, 0.2, na.rm = TRUE),
q0.4 = quantile(totcases.mil, 0.4, na.rm = TRUE),
q0.6 = quantile(totcases.mil, 0.6, na.rm = TRUE),
q0.8 = quantile(totcases.mil, 0.8, na.rm = TRUE)) %>%
pander
| totcases.mil |
1662 |
8186 |
33123 |
73388 |
#Histogram of COVID case statistics.
max(covid.NO2.df$totcases.mil, na.rm = TRUE)
## [1] 179667.4
covid.NO2.df %>%
ggplot(aes(totcases.mil)) +
geom_histogram(color = "black",fill = "grey") +
geom_vline(xintercept = mean(covid.NO2.df$totcases.mil, na.rm = T), lwd = 2) +
labs(title = "Distribution of World COVID-19 Cases per Million",
x = "Total COVID-19 Cases per Million",
y = "Number of Countries") +
theme_minimal() +
scale_x_continuous(breaks = seq(0, 179667.4,10000)) +
theme(axis.text.x = element_text(angle = 45,hjust=1))

#Statistics on world COVID death statistics.
covid.NO2.df %>%
summarize(variable = "totdeaths.mil", mean_cases = mean(totcases.mil, na.rm = T), st_dev_cty = sd(totcases, na.rm = T)) %>%
pander
| totdeaths.mil |
35928 |
3611805 |
covid.NO2.df %>%
summarize(variable = "totdeaths.mil",
q0.2 = quantile(totdeaths.mil, 0.2, na.rm = TRUE),
q0.4 = quantile(totdeaths.mil, 0.4, na.rm = TRUE),
q0.6 = quantile(totdeaths.mil, 0.6, na.rm = TRUE),
q0.8 = quantile(totdeaths.mil, 0.8, na.rm = TRUE)) %>%
pander
| totdeaths.mil |
27.78 |
132.2 |
536.1 |
1310 |
#Histogram of COVID statistics.
max(covid.NO2.df$totdeaths.mil, na.rm = TRUE)
## [1] 5820.087
covid.NO2.df %>%
ggplot(aes(totdeaths.mil)) +
geom_histogram(color = "black",fill = "grey") +
geom_vline(xintercept = mean(covid.NO2.df$totdeaths.mil, na.rm = TRUE), lwd = 2) +
labs(title = "Distribution of World COVID-19 Deaths per Million",
x = "Total COVID-19 Deaths per Million",
y = "Number of Countries") +
theme_minimal() +
scale_x_continuous(breaks = seq(0,5820.087,500)) +
theme(axis.text.x = element_text(angle = 45,hjust=1))

Bivariate analysis of NO2 concentrations, COVID data, and categorical variables (super region divisions)
#Summary statistics, NO2, grouping by Super.region
covid.NO2.df %>%
group_by(Super.region) %>%
summarize(mean_NO2 = mean(NO2_Concentration, na.rm = TRUE), sd_NO2 = sd(NO2_Concentration, na.rm = TRUE)) %>%
pander
| Central Europe, Eastern Europe, and Central Asia |
2.195e-05 |
7.39e-06 |
| High-income |
2.472e-05 |
1.7e-05 |
| Latin America and Caribbean |
1.132e-05 |
3.362e-06 |
| North Africa and the Middle East |
2.084e-05 |
9.85e-06 |
| South Asia |
2.998e-05 |
5.271e-06 |
| Southeast Asia, East Asia, and Oceania |
1.347e-05 |
1.135e-05 |
| Sub-Saharan Africa |
1.7e-05 |
6.46e-06 |
| NA |
1.149e-05 |
8.931e-06 |
#Summary statistics, COVID cases, grouping by Super.region
covid.NO2.df %>%
group_by(Super.region) %>%
summarize(mean_cases.mil = mean(totcases.mil, na.rm = TRUE), sd_cases.mil = sd(totcases.mil, na.rm = TRUE)) %>%
pander
| Central Europe, Eastern Europe, and Central Asia |
68485 |
39342 |
| High-income |
63327 |
42290 |
| Latin America and Caribbean |
30927 |
26009 |
| North Africa and the Middle East |
42067 |
39554 |
| South Asia |
11243 |
9764 |
| Southeast Asia, East Asia, and Oceania |
16298 |
41810 |
| Sub-Saharan Africa |
6235 |
11443 |
| NA |
41135 |
48023 |
#Summary statistics, COVID deaths, grouping by Super.region
covid.NO2.df %>%
group_by(Super.region) %>%
summarize(mean_deaths.mil = mean(totdeaths.mil, na.rm = TRUE), sd_deaths.mil = sd(totdeaths.mil, na.rm = TRUE)) %>%
pander
| Central Europe, Eastern Europe, and Central Asia |
1450 |
956.1 |
| High-income |
1014 |
728 |
| Latin America and Caribbean |
935.3 |
1165 |
| North Africa and the Middle East |
466.9 |
379.1 |
| South Asia |
157.5 |
135.2 |
| Southeast Asia, East Asia, and Oceania |
112.8 |
178.8 |
| Sub-Saharan Africa |
105.6 |
192.2 |
| NA |
765.5 |
906.5 |
#Histogram, NO2, grouping by Super.region
covid.NO2.df %>%
ggplot(aes(NO2_Concentration)) +
geom_histogram(color = "black",fill = "grey") +
labs(title = "Distribution of NO2 Concentrations Relative to Super Region",
x = "NO2 Concentration (mol/m^2)",
y = "Number of Countries") +
theme_minimal() +
scale_x_continuous(breaks = seq(0,8E-5,0.5E-5)) +
scale_y_continuous(breaks = seq(0,12,2)) +
theme(axis.text.x = element_text(angle = 45,hjust=1)) +
facet_grid(Super.region~.)

#Histogram, COVID cases, grouping by Super.region
covid.NO2.df %>%
ggplot(aes(totcases.mil)) +
geom_histogram(color = "black",fill = "grey") +
labs(title = "Distribution of COVID Cases Relative to Super Region",
x = "COVID-19 Cases per Million",
y = "Number of Countries") +
theme_minimal() +
scale_x_continuous(breaks = seq(0, 179667.4,10000)) +
scale_y_continuous(breaks = seq(0,32,8)) +
theme(axis.text.x = element_text(angle = 45,hjust=1)) +
facet_grid(Super.region~.)

#Histogram, COVID deaths, grouping by Super.region
covid.NO2.df %>%
ggplot(aes(totdeaths.mil)) +
geom_histogram(color = "black",fill = "grey") +
labs(title = "Distribution of COVID Deaths Relative to Super Region",
x = "COVID-19 Deaths per Million",
y = "Number of Countries") +
theme_minimal() +
scale_x_continuous(breaks = seq(0,5820.087,500)) +
scale_y_continuous(breaks = seq(0,32,8)) +
theme(axis.text.x = element_text(angle = 45,hjust=1)) +
facet_grid(Super.region~.)

#Boxplot, NO2, grouping by Super.region
covid.NO2.df %>%
ggplot(aes(Super.region,NO2_Concentration)) +
geom_boxplot() +
geom_jitter(color="red", size=0.4, alpha=0.9) +
labs(title = "Distribution of NO2 relative to Super Region",
x = "Super Region",
y = "NO2 Concentration (mol/m^2)") +
theme(axis.text.x = element_text(angle = 45,hjust=1)) +
scale_y_continuous(breaks = seq(0,8E-5,0.5E-5))

#Boxplot, COVID cases, grouping by Super.region
covid.NO2.df %>%
ggplot(aes(Super.region,totcases.mil)) +
geom_boxplot() +
geom_jitter(color="red", size=0.4, alpha=0.9) +
labs(title = "Distribution of COVID Cases Relative to Super Region",
x = "Super Region",
y = "COVID-19 Cases per Million") +
theme(axis.text.x = element_text(angle = 45,hjust=1)) +
scale_y_continuous(breaks = seq(0, 179667.4,10000))

#Boxplot, COVID deaths, grouping by Super.region
covid.NO2.df %>%
ggplot(aes(Super.region,totdeaths.mil)) +
geom_boxplot() +
geom_jitter(color="red", size=0.4, alpha=0.9) +
labs(title = "Distribution of COVID Deaths Relative to Super Region",
x = "Super Region",
y = "COVID-19 Deaths per Million") +
theme(axis.text.x = element_text(angle = 45,hjust=1)) +
scale_y_continuous(breaks = seq(0,5820.087,500))

Bivariate analysis of NO2 concentrations and all continuous variables.
covid.NO2.df %>%
select(NO2_Concentration, totcases.mil, totdeaths.mil, case.fatality.rate, pop.density, med.age, card.death, diab.prev, fem.smokers, male.smokers) %>%
cor(use="pairwise.complete.obs") %>%
pander
Table continues below
| NO2_Concentration |
1 |
0.3165 |
0.2235 |
| totcases.mil |
0.3165 |
1 |
0.7135 |
| totdeaths.mil |
0.2235 |
0.7135 |
1 |
| case.fatality.rate |
-0.1053 |
-0.1403 |
0.1426 |
| pop.density |
0.2045 |
0.0449 |
-0.03193 |
| med.age |
0.3898 |
0.5935 |
0.5198 |
| card.death |
-0.234 |
-0.2975 |
-0.2144 |
| diab.prev |
-0.2264 |
0.02145 |
-0.01058 |
| fem.smokers |
0.2739 |
0.5659 |
0.5681 |
| male.smokers |
0.04505 |
0.09914 |
0.07643 |
Table continues below
| NO2_Concentration |
-0.1053 |
0.2045 |
0.3898 |
| totcases.mil |
-0.1403 |
0.0449 |
0.5935 |
| totdeaths.mil |
0.1426 |
-0.03193 |
0.5198 |
| case.fatality.rate |
1 |
-0.07071 |
-0.1202 |
| pop.density |
-0.07071 |
1 |
0.1484 |
| med.age |
-0.1202 |
0.1484 |
1 |
| card.death |
0.223 |
-0.1755 |
-0.3436 |
| diab.prev |
0.02785 |
0.01338 |
0.1462 |
| fem.smokers |
-0.05579 |
-0.04709 |
0.6391 |
| male.smokers |
-0.01647 |
0.0001981 |
0.1816 |
| NO2_Concentration |
-0.234 |
-0.2264 |
0.2739 |
0.04505 |
| totcases.mil |
-0.2975 |
0.02145 |
0.5659 |
0.09914 |
| totdeaths.mil |
-0.2144 |
-0.01058 |
0.5681 |
0.07643 |
| case.fatality.rate |
0.223 |
0.02785 |
-0.05579 |
-0.01647 |
| pop.density |
-0.1755 |
0.01338 |
-0.04709 |
0.0001981 |
| med.age |
-0.3436 |
0.1462 |
0.6391 |
0.1816 |
| card.death |
1 |
0.1519 |
-0.1427 |
0.4285 |
| diab.prev |
0.1519 |
1 |
0.09079 |
0.2061 |
| fem.smokers |
-0.1427 |
0.09079 |
1 |
0.2261 |
| male.smokers |
0.4285 |
0.2061 |
0.2261 |
1 |
#Visual representation of correlations.
covid.NO2.df %>%
select(NO2_Concentration, totcases.mil, totdeaths.mil, case.fatality.rate, pop.density, med.age, card.death, diab.prev, fem.smokers, male.smokers) %>%
cor(use="pairwise.complete.obs") %>%
ggcorrplot(type = "lower", ggtheme = theme_minimal, colors = c("#6D9EC1","white","#E46726"),
show.diag = T,
lab = T, lab_size = 2, #shows correlation values and sets size of text
title = "Correlation Matrix for the covid.NO2 dataset",
legend.title = "Correlation Value",
outline.color = "white",
hc.order = T) #orders by variables most related

Bivariate graphs of NO2 concentrations and COVID-19 outcomes.
#NO2 concentration vs COVID cases.
ggplot(data = covid.NO2.df, aes(x = NO2_Concentration, y = totcases.mil)) +
geom_point(color = "#333aff", alpha = 1, size = 1) +
geom_smooth(color = "red") +
geom_smooth(method = "lm", color = "purple") +
theme_bw() +
labs(x = "NO2 Concentration (mol/m^2)", y = "Total COVID-19 Cases per Million People") +
labs(title = "World COVID-19 Cases per Million People vs. NO2 Concentration")

cor(covid.NO2.df$totcases.mil, covid.NO2.df$NO2_Concentration, use = "complete.obs")
## [1] 0.3165363
NO2.lm.cases <- lm(totcases.mil ~ NO2_Concentration, data = covid.NO2.df)
summary.lm(NO2.lm.cases)
##
## Call:
## lm(formula = totcases.mil ~ NO2_Concentration, data = covid.NO2.df)
##
## Residuals:
## Min 1Q Median 3Q Max
## -90810 -28883 -12346 22261 137741
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.364e+04 5.741e+03 2.376 0.0185 *
## NO2_Concentration 1.211e+09 2.660e+08 4.551 9.62e-06 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 39170 on 186 degrees of freedom
## (64 observations deleted due to missingness)
## Multiple R-squared: 0.1002, Adjusted R-squared: 0.09536
## F-statistic: 20.71 on 1 and 186 DF, p-value: 9.621e-06
confint(NO2.lm.cases) #Summary statistics for linear fit.
## 2.5 % 97.5 %
## (Intercept) 2.313445e+03 2.496619e+04
## NO2_Concentration 6.858510e+08 1.735461e+09
#NO2 concentration vs COVID deaths.
ggplot(data = covid.NO2.df, aes(x = NO2_Concentration, y = totdeaths.mil)) +
geom_point(color = "#333aff", alpha = 1, size = 1) +
geom_smooth(color = "red") +
geom_smooth(method = "lm", color = "purple") +
theme_bw() +
labs(x = "NO2 Concentration (mol/m^2)", y = "Total COVID-19 Deaths per Million People") +
labs(title = "World COVID-19 Deaths per Million People vs. NO2 Concentration")

cor(covid.NO2.df$totdeaths.mil, covid.NO2.df$NO2_Concentration, use = "complete.obs")
## [1] 0.2234731
NO2.lm.deaths <- lm(totdeaths.mil ~ NO2_Concentration, data = covid.NO2.df,)
summary.lm(NO2.lm.deaths)
##
## Call:
## lm(formula = totdeaths.mil ~ NO2_Concentration, data = covid.NO2.df)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1484.4 -571.6 -372.9 387.4 5333.7
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 3.332e+02 1.284e+02 2.596 0.01021 *
## NO2_Concentration 1.797e+07 5.858e+06 3.067 0.00249 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 841 on 179 degrees of freedom
## (71 observations deleted due to missingness)
## Multiple R-squared: 0.04994, Adjusted R-squared: 0.04463
## F-statistic: 9.409 on 1 and 179 DF, p-value: 0.002494
confint(NO2.lm.deaths) #Summary statistics for linear fit.
## 2.5 % 97.5 %
## (Intercept) 7.992408e+01 5.864739e+02
## NO2_Concentration 6.409040e+06 2.952680e+07
regions.list <- c("High-income", "Latin America and Caribbean", "Sub-Saharan Africa", "North Africa and the Middle East", "South Asia", "Southeast Asia, East Asia, and Oceania", "Central Europe, Eastern Europe, and Central Asia")
sub.regions.list <- c("High-income Asia Pacific", "High-income Australasia", "High-income North America", "High-income Southern Latin America", "High-income Western Europe", "Caribbean", "Central Latin America", "Tropical Latin America", "Andean Latin America", "Central sub-Saharan Africa", "Eastern sub-Saharan Africa", "Southern sub-Saharan Africa", "Western sub-Saharan Africa", "North Africa and the Middle East", "South Asia", "East Asia", "Oceania", "Southeast Asia", "Central Asia", "Central Europe", "Eastern Europe")
#Function for bivariate analysis by region.
cases.NO2 <- function(x) {
covid.NO2.df %>%
filter(Super.region == x) %>%
filter(!is.na(totdeaths.mil)) %>%
filter(!is.na(NO2_Concentration)) %>%
ggplot(aes(x = NO2_Concentration, y = totcases.mil)) +
geom_point(color = "#333aff", size = 1) +
geom_smooth(color = "red") +
geom_smooth(method = "lm", color = "purple") +
theme_bw() +
labs(x = "NO2 Concentration (mol/m^2)", y = "Total COVID-19 Cases per Million People") +
labs(title = paste0("COVID-19 Cases per Million People in ", (Super.region = x), " vs. NO2 Concentration"))
}
NO2.lm.cases <- function(x) {
covid.NO2.df %>%
filter(Super.region == x) %>%
filter(!is.na(totdeaths.mil)) %>%
filter(!is.na(NO2_Concentration)) %>%
lm(totcases.mil ~ NO2_Concentration,.) %>%
summary.lm()
} #Function for linear regression statistics to be included in for loop below.
for (i in regions.list) {
print(cases.NO2(i))
print(NO2.lm.cases(i))
} #Loops function for continents of interest.

##
## Call:
## lm(formula = totcases.mil ~ NO2_Concentration, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -78182 -33098 9082 23797 114373
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 52150 13590 3.838 0.000573 ***
## NO2_Concentration 438853382 448383204 0.979 0.335282
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 42320 on 31 degrees of freedom
## Multiple R-squared: 0.02998, Adjusted R-squared: -0.001316
## F-statistic: 0.9579 on 1 and 31 DF, p-value: 0.3353

##
## Call:
## lm(formula = totcases.mil ~ NO2_Concentration, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -32144 -16754 -7505 2170 62157
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 43205 17159 2.518 0.0183 *
## NO2_Concentration -987233958 1439547473 -0.686 0.4989
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 26160 on 26 degrees of freedom
## Multiple R-squared: 0.01777, Adjusted R-squared: -0.02001
## F-statistic: 0.4703 on 1 and 26 DF, p-value: 0.4989

##
## Call:
## lm(formula = totcases.mil ~ NO2_Concentration, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -9740 -5594 -3283 -1344 48613
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 13633 6738 2.023 0.0496 *
## NO2_Concentration -454287265 399732943 -1.136 0.2624
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 11400 on 41 degrees of freedom
## Multiple R-squared: 0.03054, Adjusted R-squared: 0.006895
## F-statistic: 1.292 on 1 and 41 DF, p-value: 0.2624

##
## Call:
## lm(formula = totcases.mil ~ NO2_Concentration, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -43562 -23508 -12602 19146 94637
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -4333 17595 -0.246 0.8081
## NO2_Concentration 2226431334 766638920 2.904 0.0091 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 33770 on 19 degrees of freedom
## Multiple R-squared: 0.3074, Adjusted R-squared: 0.271
## F-statistic: 8.434 on 1 and 19 DF, p-value: 0.009095

##
## Call:
## lm(formula = totcases.mil ~ NO2_Concentration, data = .)
##
## Residuals:
## 1 2 3 4 5
## -9195 -7454 9986 10206 -3543
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -2922 31378 -0.093 0.932
## NO2_Concentration 472550653 1034079847 0.457 0.679
##
## Residual standard error: 10900 on 3 degrees of freedom
## Multiple R-squared: 0.06508, Adjusted R-squared: -0.2466
## F-statistic: 0.2088 on 1 and 3 DF, p-value: 0.6787

##
## Call:
## lm(formula = totcases.mil ~ NO2_Concentration, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -36541 -25947 -10363 168 121820
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 4.611e+04 1.930e+04 2.389 0.0296 *
## NO2_Concentration -1.636e+09 1.047e+09 -1.563 0.1376
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 44650 on 16 degrees of freedom
## Multiple R-squared: 0.1324, Adjusted R-squared: 0.07822
## F-statistic: 2.443 on 1 and 16 DF, p-value: 0.1376

##
## Call:
## lm(formula = totcases.mil ~ NO2_Concentration, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -56913 -26986 -7456 21585 92022
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 7.361e+03 2.029e+04 0.363 0.71967
## NO2_Concentration 2.772e+09 8.726e+08 3.177 0.00382 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 34030 on 26 degrees of freedom
## Multiple R-squared: 0.2796, Adjusted R-squared: 0.2519
## F-statistic: 10.09 on 1 and 26 DF, p-value: 0.003815
deaths.NO2 <- function(x) {
covid.NO2.df %>%
filter(Super.region == x) %>%
filter(!is.na(totdeaths.mil)) %>%
filter(!is.na(NO2_Concentration)) %>%
ggplot(aes(x = NO2_Concentration, y = totdeaths.mil)) +
geom_point(color = "#333aff", size = 1) +
geom_smooth(color = "red") +
geom_smooth(method = "lm", color = "purple") +
theme_bw() +
labs(x = "NO2 Concentration (mol/m^2)", y = "Total COVID-19 Deaths per Million People") +
labs(title = paste0("COVID-19 Deaths per Million People in ", (Super.region = x), " vs. NO2 Concentration"))
}
NO2.lm.deaths <- function(x) {
covid.NO2.df %>%
filter(Super.region == x) %>%
filter(!is.na(totdeaths.mil)) %>%
filter(!is.na(NO2_Concentration)) %>%
lm(totdeaths.mil ~ NO2_Concentration,.) %>%
summary.lm() #Function for linear regression statistics to be included in for loop below.
}
for (i in regions.list) {
print(deaths.NO2(i))
print(NO2.lm.deaths(i))
} #Loops function for continents of interest.

##
## Call:
## lm(formula = totdeaths.mil ~ NO2_Concentration, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1227.49 -777.21 60.21 659.16 1133.84
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 856.1 235.1 3.641 0.000979 ***
## NO2_Concentration 6198355.3 7757313.5 0.799 0.430351
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 732.1 on 31 degrees of freedom
## Multiple R-squared: 0.02018, Adjusted R-squared: -0.01143
## F-statistic: 0.6385 on 1 and 31 DF, p-value: 0.4304

##
## Call:
## lm(formula = totdeaths.mil ~ NO2_Concentration, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -958.7 -603.5 -376.9 335.6 4779.2
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.352e+03 7.743e+02 1.746 0.0925 .
## NO2_Concentration -3.652e+07 6.496e+07 -0.562 0.5788
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 1180 on 26 degrees of freedom
## Multiple R-squared: 0.01201, Adjusted R-squared: -0.02599
## F-statistic: 0.3161 on 1 and 26 DF, p-value: 0.5788

##
## Call:
## lm(formula = totdeaths.mil ~ NO2_Concentration, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -105.40 -86.65 -69.60 -11.17 915.43
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 126.8 114.9 1.104 0.276
## NO2_Concentration -1301481.1 6816614.0 -0.191 0.850
##
## Residual standard error: 194.5 on 41 degrees of freedom
## Multiple R-squared: 0.0008883, Adjusted R-squared: -0.02348
## F-statistic: 0.03645 on 1 and 41 DF, p-value: 0.8495

##
## Call:
## lm(formula = totdeaths.mil ~ NO2_Concentration, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -460.2 -226.6 -129.6 173.6 861.3
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.023e+02 1.805e+02 0.567 0.5775
## NO2_Concentration 1.749e+07 7.864e+06 2.225 0.0384 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 346.4 on 19 degrees of freedom
## Multiple R-squared: 0.2066, Adjusted R-squared: 0.1649
## F-statistic: 4.949 on 1 and 19 DF, p-value: 0.03843

##
## Call:
## lm(formula = totdeaths.mil ~ NO2_Concentration, data = .)
##
## Residuals:
## 1 2 3 4 5
## -108.53 -143.81 122.43 149.24 -19.33
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 2.313e-01 4.400e+02 0.001 1.000
## NO2_Concentration 5.247e+06 1.450e+07 0.362 0.741
##
## Residual standard error: 152.9 on 3 degrees of freedom
## Multiple R-squared: 0.04182, Adjusted R-squared: -0.2776
## F-statistic: 0.1309 on 1 and 3 DF, p-value: 0.7414

##
## Call:
## lm(formula = totdeaths.mil ~ NO2_Concentration, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -172.33 -125.39 -27.02 49.87 515.71
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 2.137e+02 7.379e+01 2.897 0.0105 *
## NO2_Concentration -6.528e+06 4.001e+06 -1.632 0.1222
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 170.7 on 16 degrees of freedom
## Multiple R-squared: 0.1427, Adjusted R-squared: 0.0891
## F-statistic: 2.663 on 1 and 16 DF, p-value: 0.1222

##
## Call:
## lm(formula = totdeaths.mil ~ NO2_Concentration, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1217.34 -503.24 13.44 411.01 1779.79
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -440.9 429.5 -1.026 0.314
## NO2_Concentration 85772376.4 18474796.8 4.643 8.63e-05 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 720.4 on 26 degrees of freedom
## Multiple R-squared: 0.4533, Adjusted R-squared: 0.4322
## F-statistic: 21.55 on 1 and 26 DF, p-value: 8.633e-05
Bivariate graphs of population weighted NO2 concentrations and COVID-19 outcomes.
#NO2 concentration vs COVID cases.
ggplot(data = weighted.covid.NO2.df, aes(x = pop.weighted.NO2, y = totcases.mil)) +
geom_point(color = "#333aff", alpha = 1, size = 1) +
geom_smooth(color = "red") +
geom_smooth(method = "lm", color = "purple") +
theme_bw() +
labs(x = "Weighted NO2 Concentration (mol/m^2)", y = "Total COVID-19 Cases per Million People") +
labs(title = "World COVID-19 Cases per Million People vs. Weighted NO2 Concentration")

cor(weighted.covid.NO2.df$totcases.mil, weighted.covid.NO2.df$pop.weighted.NO2, use = "complete.obs")
## [1] 0.1993439
NO2.lm.cases <- lm(totcases.mil ~ pop.weighted.NO2, data = weighted.covid.NO2.df)
summary.lm(NO2.lm.cases)
##
## Call:
## lm(formula = totcases.mil ~ pop.weighted.NO2, data = weighted.covid.NO2.df)
##
## Residuals:
## Min 1Q Median 3Q Max
## -57105 -30596 -15063 26642 151847
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 2.782e+04 4.250e+03 6.547 5.57e-10 ***
## pop.weighted.NO2 4.406e+12 1.588e+12 2.774 0.0061 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 40460 on 186 degrees of freedom
## (64 observations deleted due to missingness)
## Multiple R-squared: 0.03974, Adjusted R-squared: 0.03458
## F-statistic: 7.697 on 1 and 186 DF, p-value: 0.006095
confint(NO2.lm.cases) #Summary statistics for linear fit.
## 2.5 % 97.5 %
## (Intercept) 1.943685e+04 3.620427e+04
## pop.weighted.NO2 1.273021e+12 7.539258e+12
#NO2 concentration vs COVID deaths.
ggplot(data = weighted.covid.NO2.df, aes(x = pop.weighted.NO2, y = totdeaths.mil)) +
geom_point(color = "#333aff", alpha = 1, size = 1) +
geom_smooth(color = "red") +
geom_smooth(method = "lm", color = "purple") +
theme_bw() +
labs(x = "Weighted NO2 Concentration (mol/m^2)", y = "Total COVID-19 Deaths per Million People") +
labs(title = "World COVID-19 Deaths per Million People vs. Weighted NO2 Concentration")

cor(weighted.covid.NO2.df$totdeaths.mil, weighted.covid.NO2.df$pop.weighted.NO2, use = "complete.obs")
## [1] 0.1763399
NO2.lm.deaths <- lm(totdeaths.mil ~ pop.weighted.NO2, data = weighted.covid.NO2.df,)
summary.lm(NO2.lm.deaths)
##
## Call:
## lm(formula = totdeaths.mil ~ pop.weighted.NO2, data = weighted.covid.NO2.df)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1272.7 -577.4 -403.9 348.4 5236.7
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 5.139e+02 9.285e+01 5.534 1.1e-07 ***
## pop.weighted.NO2 8.161e+10 3.405e+10 2.397 0.0176 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 849.3 on 179 degrees of freedom
## (71 observations deleted due to missingness)
## Multiple R-squared: 0.0311, Adjusted R-squared: 0.02568
## F-statistic: 5.745 on 1 and 179 DF, p-value: 0.01757
confint(NO2.lm.deaths) #Summary statistics for linear fit.
## 2.5 % 97.5 %
## (Intercept) 3.306166e+02 6.97076e+02
## pop.weighted.NO2 1.442044e+10 1.48798e+11
regions.list <- c("High-income", "Latin America and Caribbean", "Sub-Saharan Africa", "North Africa and the Middle East", "South Asia", "Southeast Asia, East Asia, and Oceania", "Central Europe, Eastern Europe, and Central Asia")
sub.regions.list <- c("High-income Asia Pacific", "High-income Australasia", "High-income North America", "High-income Southern Latin America", "High-income Western Europe", "Caribbean", "Central Latin America", "Tropical Latin America", "Andean Latin America", "Central sub-Saharan Africa", "Eastern sub-Saharan Africa", "Southern sub-Saharan Africa", "Western sub-Saharan Africa", "North Africa and the Middle East", "South Asia", "East Asia", "Oceania", "Southeast Asia", "Central Asia", "Central Europe", "Eastern Europe")
#Function for bivariate analysis by region.
cases.NO2.w <- function(x) {
weighted.covid.NO2.df %>%
filter(Super.region == x) %>%
filter(!is.na(totdeaths.mil)) %>%
filter(!is.na(pop.weighted.NO2)) %>%
ggplot(aes(x = pop.weighted.NO2, y = totcases.mil)) +
geom_point(color = "#333aff", size = 1) +
geom_smooth(color = "red") +
geom_smooth(method = "lm", color = "purple") +
theme_bw() +
labs(x = "Weighted NO2 Concentration (mol/m^2)", y = "Total COVID-19 Cases per Million People") +
labs(title = paste0("COVID-19 Cases per Million People in ", (Super.region = x), " vs. Weighted NO2 Concentration"))
}
NO2.lm.cases.w <- function(x) {
weighted.covid.NO2.df %>%
filter(Super.region == x) %>%
filter(!is.na(totdeaths.mil)) %>%
filter(!is.na(pop.weighted.NO2)) %>%
lm(totcases.mil ~ pop.weighted.NO2,.) %>%
summary.lm()
} #Function for linear regression statistics to be included in for loop below.
for (i in regions.list) {
print(cases.NO2.w(i))
print(NO2.lm.cases.w(i))
} #Loops function for continents of interest.

##
## Call:
## lm(formula = totcases.mil ~ pop.weighted.NO2, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -64931 -40260 10414 30182 112615
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 6.705e+04 1.263e+04 5.309 8.85e-06 ***
## pop.weighted.NO2 -1.385e+12 3.788e+12 -0.366 0.717
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 42870 on 31 degrees of freedom
## Multiple R-squared: 0.004294, Adjusted R-squared: -0.02783
## F-statistic: 0.1337 on 1 and 31 DF, p-value: 0.7171

##
## Call:
## lm(formula = totcases.mil ~ pop.weighted.NO2, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -40870 -15279 -7329 5880 57138
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 2.771e+04 7.714e+03 3.592 0.00134 **
## pop.weighted.NO2 4.663e+12 6.534e+12 0.714 0.48181
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 26140 on 26 degrees of freedom
## Multiple R-squared: 0.01921, Adjusted R-squared: -0.01851
## F-statistic: 0.5093 on 1 and 26 DF, p-value: 0.4818

##
## Call:
## lm(formula = totcases.mil ~ pop.weighted.NO2, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -6736 -4698 -4014 -1864 50141
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 8.132e+03 3.848e+03 2.114 0.0407 *
## pop.weighted.NO2 -1.341e+12 2.418e+12 -0.554 0.5823
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 11540 on 41 degrees of freedom
## Multiple R-squared: 0.007442, Adjusted R-squared: -0.01677
## F-statistic: 0.3074 on 1 and 41 DF, p-value: 0.5823

##
## Call:
## lm(formula = totcases.mil ~ pop.weighted.NO2, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -41663 -36786 -6911 24056 117570
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 3.845e+04 1.178e+04 3.263 0.00409 **
## pop.weighted.NO2 1.228e+12 2.656e+12 0.462 0.64916
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 40360 on 19 degrees of freedom
## Multiple R-squared: 0.01112, Adjusted R-squared: -0.04093
## F-statistic: 0.2137 on 1 and 19 DF, p-value: 0.6492

##
## Call:
## lm(formula = totcases.mil ~ pop.weighted.NO2, data = .)
##
## Residuals:
## 1 2 3 4 5
## -3081.2 -1309.4 11898.8 292.2 -7800.4
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -6.558e+03 1.220e+04 -0.537 0.628
## pop.weighted.NO2 5.292e+12 3.450e+12 1.534 0.223
##
## Residual standard error: 8440 on 3 degrees of freedom
## Multiple R-squared: 0.4396, Adjusted R-squared: 0.2528
## F-statistic: 2.353 on 1 and 3 DF, p-value: 0.2226

##
## Call:
## lm(formula = totcases.mil ~ pop.weighted.NO2, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -33382 -23708 -14100 -5892 123597
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 3.482e+04 1.461e+04 2.383 0.0299 *
## pop.weighted.NO2 -9.426e+12 6.723e+12 -1.402 0.1800
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 45240 on 16 degrees of freedom
## Multiple R-squared: 0.1094, Adjusted R-squared: 0.05374
## F-statistic: 1.965 on 1 and 16 DF, p-value: 0.18

##
## Call:
## lm(formula = totcases.mil ~ pop.weighted.NO2, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -56366 -25035 -83 21727 77966
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 2.417e+04 1.960e+04 1.233 0.2285
## pop.weighted.NO2 1.522e+13 6.308e+12 2.413 0.0232 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 36240 on 26 degrees of freedom
## Multiple R-squared: 0.183, Adjusted R-squared: 0.1516
## F-statistic: 5.823 on 1 and 26 DF, p-value: 0.02317
deaths.NO2.w <- function(x) {
weighted.covid.NO2.df %>%
filter(Super.region == x) %>%
filter(!is.na(totdeaths.mil)) %>%
filter(!is.na(pop.weighted.NO2)) %>%
ggplot(aes(x = pop.weighted.NO2, y = totdeaths.mil)) +
geom_point(color = "#333aff", size = 1) +
geom_smooth(color = "red") +
geom_smooth(method = "lm", color = "purple") +
theme_bw() +
labs(x = "Weighted NO2 Concentration (mol/m^2)", y = "Total COVID-19 Deaths per Million People") +
labs(title = paste0("COVID-19 Deaths per Million People in ", (Super.region = x), " vs. Weighted NO2 Concentration"))
}
NO2.lm.deaths.w <- function(x) {
weighted.covid.NO2.df %>%
filter(Super.region == x) %>%
filter(!is.na(totdeaths.mil)) %>%
filter(!is.na(pop.weighted.NO2)) %>%
lm(totdeaths.mil ~ pop.weighted.NO2,.) %>%
summary.lm() #Function for linear regression statistics to be included in for loop below.
}
for (i in regions.list) {
print(deaths.NO2.w(i))
print(NO2.lm.deaths.w(i))
} #Loops function for continents of interest.

##
## Call:
## lm(formula = totdeaths.mil ~ pop.weighted.NO2, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1053.80 -841.00 32.75 668.08 1157.03
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 9.185e+02 2.168e+02 4.236 0.000189 ***
## pop.weighted.NO2 3.551e+10 6.503e+10 0.546 0.588895
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 736.1 on 31 degrees of freedom
## Multiple R-squared: 0.009529, Adjusted R-squared: -0.02242
## F-statistic: 0.2982 on 1 and 31 DF, p-value: 0.5889

##
## Call:
## lm(formula = totdeaths.mil ~ pop.weighted.NO2, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1334.0 -611.0 -308.5 285.3 4895.3
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 7.607e+02 3.476e+02 2.188 0.0378 *
## pop.weighted.NO2 1.926e+11 2.944e+11 0.654 0.5188
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 1178 on 26 degrees of freedom
## Multiple R-squared: 0.01619, Adjusted R-squared: -0.02165
## F-statistic: 0.4278 on 1 and 26 DF, p-value: 0.5188

##
## Call:
## lm(formula = totdeaths.mil ~ pop.weighted.NO2, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -149.73 -103.62 -58.94 -6.57 808.58
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 4.223e+01 6.391e+01 0.661 0.512
## pop.weighted.NO2 4.480e+10 4.017e+10 1.115 0.271
##
## Residual standard error: 191.7 on 41 degrees of freedom
## Multiple R-squared: 0.02945, Adjusted R-squared: 0.005776
## F-statistic: 1.244 on 1 and 41 DF, p-value: 0.2712

##
## Call:
## lm(formula = totdeaths.mil ~ pop.weighted.NO2, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -425.56 -322.47 -72.51 285.37 788.37
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 4.127e+02 1.120e+02 3.684 0.00158 **
## pop.weighted.NO2 1.839e+10 2.525e+10 0.728 0.47528
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 383.6 on 19 degrees of freedom
## Multiple R-squared: 0.02716, Adjusted R-squared: -0.02404
## F-statistic: 0.5305 on 1 and 19 DF, p-value: 0.4753

##
## Call:
## lm(formula = totdeaths.mil ~ pop.weighted.NO2, data = .)
##
## Residuals:
## 1 2 3 4 5
## -27.14 -39.47 149.50 -11.88 -71.01
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -1.287e+02 1.442e+02 -0.893 0.438
## pop.weighted.NO2 8.508e+10 4.076e+10 2.087 0.128
##
## Residual standard error: 99.72 on 3 degrees of freedom
## Multiple R-squared: 0.5922, Adjusted R-squared: 0.4563
## F-statistic: 4.357 on 1 and 3 DF, p-value: 0.1281

##
## Call:
## lm(formula = totdeaths.mil ~ pop.weighted.NO2, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -152.68 -121.56 -54.04 75.22 526.69
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.648e+02 5.641e+01 2.921 0.010 **
## pop.weighted.NO2 -3.499e+10 2.596e+10 -1.348 0.196
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 174.7 on 16 degrees of freedom
## Multiple R-squared: 0.102, Adjusted R-squared: 0.04587
## F-statistic: 1.817 on 1 and 16 DF, p-value: 0.1964

##
## Call:
## lm(formula = totdeaths.mil ~ pop.weighted.NO2, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1291.22 -692.02 -88.65 581.03 1886.11
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 4.747e+02 4.858e+02 0.977 0.3374
## pop.weighted.NO2 3.351e+11 1.563e+11 2.143 0.0416 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 898.2 on 26 degrees of freedom
## Multiple R-squared: 0.1502, Adjusted R-squared: 0.1175
## F-statistic: 4.594 on 1 and 26 DF, p-value: 0.04162
Bivariate graphs of NO2 concentrations and other continuous variables.
#NO2 concentration vs population density.
ggplot(data = covid.NO2.df, aes(x = NO2_Concentration, y = pop.density)) +
geom_point(color = "#333aff", alpha = 1) +
geom_smooth(color = "red") +
geom_smooth(method = "lm", color = "purple") +
theme_bw() +
labs(x = "NO2 Concentration (mol/m^2)", y = "Population Density") +
labs(title = "World Population Density vs. NO2 Concentration")

cor(covid.NO2.df$pop.density, covid.NO2.df$NO2_Concentration, use = "complete.obs")
## [1] 0.2045035
NO2.lm.pop <- lm(pop.density ~ NO2_Concentration, data = covid.NO2.df,)
summary.lm(NO2.lm.pop)
##
## Call:
## lm(formula = pop.density ~ NO2_Concentration, data = covid.NO2.df)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2374.0 -516.0 -231.7 -3.8 19313.8
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -281.4 293.8 -0.958 0.33933
## NO2_Concentration 40668664.8 13904464.2 2.925 0.00385 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 2095 on 196 degrees of freedom
## (54 observations deleted due to missingness)
## Multiple R-squared: 0.04182, Adjusted R-squared: 0.03693
## F-statistic: 8.555 on 1 and 196 DF, p-value: 0.003852
confint(NO2.lm.pop) #Summary statistics for linear fit.
## 2.5 % 97.5 %
## (Intercept) -860.8002 2.979961e+02
## NO2_Concentration 13247097.7417 6.809023e+07
#NO2 concentration vs median age.
ggplot(data = covid.NO2.df, aes(x = NO2_Concentration, y = med.age)) +
geom_point(color = "#333aff", alpha = 1) +
geom_smooth(color = "red") +
geom_smooth(method = "lm", color = "purple") +
theme_bw() +
labs(x = "NO2 Concentration (mol/m^2)", y = "Median Age") +
labs(title = "World Median Age by Country vs. NO2 Concentration")

cor(covid.NO2.df$med.age, covid.NO2.df$NO2_Concentration, use = "complete.obs")
## [1] 0.3897704
NO2.lm.age <- lm(med.age ~ NO2_Concentration, data = covid.NO2.df,)
summary.lm(NO2.lm.age)
##
## Call:
## lm(formula = med.age ~ NO2_Concentration, data = covid.NO2.df)
##
## Residuals:
## Min 1Q Median 3Q Max
## -15.2819 -7.6082 0.2393 6.8515 14.9838
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 2.437e+01 1.237e+00 19.70 < 2e-16 ***
## NO2_Concentration 3.281e+05 5.746e+04 5.71 4.53e-08 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 8.4 on 182 degrees of freedom
## (68 observations deleted due to missingness)
## Multiple R-squared: 0.1519, Adjusted R-squared: 0.1473
## F-statistic: 32.6 on 1 and 182 DF, p-value: 4.528e-08
confint(NO2.lm.age) #Summary statistics for linear fit.
## 2.5 % 97.5 %
## (Intercept) 21.92602 26.80561
## NO2_Concentration 214701.10076 441432.36905
#NO2 concentration vs GDP per capita.
ggplot(data = covid.NO2.df, aes(x = NO2_Concentration, y = gdp.cap)) +
geom_point(color = "#333aff", alpha = 1) +
geom_smooth(color = "red") +
geom_smooth(method = "lm", color = "purple") +
theme_bw() +
labs(x = "NO2 Concentration (mol/m^2)", y = "GDP per Capita") +
labs(title = "World GDP per Capita vs. NO2 Concentration")

cor(covid.NO2.df$gdp.cap, covid.NO2.df$NO2_Concentration, use = "complete.obs")
## [1] 0.3524915
NO2.lm.gdp <- lm(gdp.cap ~ NO2_Concentration, data = covid.NO2.df,)
summary.lm(NO2.lm.gdp)
##
## Call:
## lm(formula = gdp.cap ~ NO2_Concentration, data = covid.NO2.df)
##
## Residuals:
## Min 1Q Median 3Q Max
## -30294 -13965 -5412 6907 88128
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 6948 2851 2.437 0.0158 *
## NO2_Concentration 680456994 133541576 5.095 8.62e-07 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 19450 on 183 degrees of freedom
## (67 observations deleted due to missingness)
## Multiple R-squared: 0.1243, Adjusted R-squared: 0.1195
## F-statistic: 25.96 on 1 and 183 DF, p-value: 8.62e-07
confint(NO2.lm.gdp) #Summary statistics for linear fit.
## 2.5 % 97.5 %
## (Intercept) 1.322168e+03 12573.53
## NO2_Concentration 4.169779e+08 943936113.77
#NO2 concentration vs cardiovascular death.
ggplot(data = covid.NO2.df, aes(x = NO2_Concentration, y = card.death)) +
geom_point(color = "#333aff", alpha = 1) +
geom_smooth(color = "red") +
geom_smooth(method = "lm", color = "purple") +
theme_bw() +
labs(x = "NO2 Concentration (mol/m^2)", y = "Cardiovascular Death Rates") +
labs(title = "World Cardiovascular Death Rates vs. NO2 Concentration")

cor(covid.NO2.df$card.death, covid.NO2.df$NO2_Concentration, use = "complete.obs")
## [1] -0.2339947
NO2.lm.card.death <- lm(card.death ~ NO2_Concentration, data = covid.NO2.df,)
summary.lm(NO2.lm.card.death)
##
## Call:
## lm(formula = card.death ~ NO2_Concentration, data = covid.NO2.df)
##
## Residuals:
## Min 1Q Median 3Q Max
## -204.00 -91.69 -20.65 69.54 462.64
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 3.124e+02 1.746e+01 17.894 < 2e-16 ***
## NO2_Concentration -2.656e+06 8.180e+05 -3.247 0.00139 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 119.5 on 182 degrees of freedom
## (68 observations deleted due to missingness)
## Multiple R-squared: 0.05475, Adjusted R-squared: 0.04956
## F-statistic: 10.54 on 1 and 182 DF, p-value: 0.001389
confint(NO2.lm.card.death) #Summary statistics for linear fit.
## 2.5 % 97.5 %
## (Intercept) 277.9489 346.8407
## NO2_Concentration -4270000.3363 -1041995.4937
#NO2 concentration vs diabetes prevalence.
ggplot(data = covid.NO2.df, aes(x = NO2_Concentration, y = diab.prev)) +
geom_point(color = "#333aff", alpha = 1) +
geom_smooth(color = "red") +
geom_smooth(method = "lm", color = "purple") +
theme_bw() +
labs(x = "NO2 Concentration (mol/m^2)", y = "Diabetes Prevalence Rates") +
labs(title = "World Diabetes Prevalence Rates vs. NO2 Concentration")

cor(covid.NO2.df$diab.prev, covid.NO2.df$NO2_Concentration, use = "complete.obs")
## [1] -0.2263737
NO2.lm.diab <- lm(diab.prev ~ NO2_Concentration, data = covid.NO2.df,)
summary.lm(NO2.lm.diab)
##
## Call:
## lm(formula = diab.prev ~ NO2_Concentration, data = covid.NO2.df)
##
## Residuals:
## Min 1Q Median 3Q Max
## -7.9664 -2.9376 -0.6631 2.3314 20.9495
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.014e+01 6.546e-01 15.485 < 2e-16 ***
## NO2_Concentration -9.990e+04 3.110e+04 -3.212 0.00155 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 4.623 on 191 degrees of freedom
## (59 observations deleted due to missingness)
## Multiple R-squared: 0.05125, Adjusted R-squared: 0.04628
## F-statistic: 10.32 on 1 and 191 DF, p-value: 0.001547
confint(NO2.lm.diab) #Summary statistics for linear fit.
## 2.5 % 97.5 %
## (Intercept) 8.845719e+00 11.42813
## NO2_Concentration -1.612537e+05 -38551.92814
Multivariate graphs of COVID outcomes vs NO2 concentrations.
#NO2 concentration vs COVID cases.
ggplot(data = covid.NO2.df, aes(x = NO2_Concentration, y = totcases.mil)) +
geom_point(color = "#333aff", alpha = 1) +
geom_smooth(color = "red") +
geom_smooth(method = "lm", color = "purple") +
theme_bw() +
labs(x = "NO2 Concentration (mol/m^2)", y = "Total COVID-19 Cases per Million People") +
labs(title = "World COVID-19 Cases per Million People vs. NO2 Concentration")

cor(covid.NO2.df$totcases.mil, covid.NO2.df$NO2_Concentration, use = "complete.obs")
## [1] 0.3165363
NO2.lm.cases <- lm(totcases.mil ~ NO2_Concentration + gdp.cap + pop.density + med.age, data = covid.NO2.df)
summary.lm(NO2.lm.cases)
##
## Call:
## lm(formula = totcases.mil ~ NO2_Concentration + gdp.cap + pop.density +
## med.age, data = covid.NO2.df)
##
## Residuals:
## Min 1Q Median 3Q Max
## -78822 -14001 -4366 9912 118443
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -4.057e+04 9.193e+03 -4.413 1.80e-05 ***
## NO2_Concentration 2.755e+08 2.418e+08 1.139 0.2563
## gdp.cap 2.713e-01 1.633e-01 1.661 0.0986 .
## pop.density -7.380e+00 3.021e+00 -2.443 0.0156 *
## med.age 2.239e+03 3.517e+02 6.367 1.71e-09 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 31160 on 171 degrees of freedom
## (76 observations deleted due to missingness)
## Multiple R-squared: 0.3929, Adjusted R-squared: 0.3787
## F-statistic: 27.67 on 4 and 171 DF, p-value: < 2.2e-16
confint(NO2.lm.cases) #Summary statistics for linear fit.
## 2.5 % 97.5 %
## (Intercept) -5.871916e+04 -2.242532e+04
## NO2_Concentration -2.018993e+08 7.528626e+08
## gdp.cap -5.116587e-02 5.936683e-01
## pop.density -1.334335e+01 -1.416295e+00
## med.age 1.545231e+03 2.933764e+03
#NO2 concentration vs COVID deaths.
ggplot(data = covid.NO2.df, aes(x = NO2_Concentration, y = totdeaths.mil)) +
geom_point(color = "#333aff", alpha = 1) +
geom_smooth(color = "red") +
geom_smooth(method = "lm", color = "purple") +
theme_bw() +
labs(x = "NO2 Concentration (mol/m^2)", y = "Total COVID-19 Deaths per Million People") +
labs(title = "World COVID-19 Deaths per Million People vs. NO2 Concentration")

cor(covid.NO2.df$totdeaths.mil, covid.NO2.df$NO2_Concentration, use = "complete.obs")
## [1] 0.2234731
NO2.lm.deaths <- lm(totdeaths.mil ~ NO2_Concentration + gdp.cap + pop.density + med.age, data = covid.NO2.df,)
summary.lm(NO2.lm.deaths)
##
## Call:
## lm(formula = totdeaths.mil ~ NO2_Concentration + gdp.cap + pop.density +
## med.age, data = covid.NO2.df)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1545.1 -361.5 -88.4 211.0 5187.3
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -1.114e+03 2.111e+02 -5.276 4.06e-07 ***
## NO2_Concentration 4.054e+06 5.544e+06 0.731 0.4657
## gdp.cap -8.090e-03 3.700e-03 -2.186 0.0302 *
## pop.density -1.727e-01 6.841e-02 -2.524 0.0125 *
## med.age 6.239e+01 7.971e+00 7.827 5.46e-13 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 705.4 on 167 degrees of freedom
## (80 observations deleted due to missingness)
## Multiple R-squared: 0.3394, Adjusted R-squared: 0.3235
## F-statistic: 21.45 on 4 and 167 DF, p-value: 2.721e-14
confint(NO2.lm.deaths) #Summary statistics for linear fit.
## 2.5 % 97.5 %
## (Intercept) -1.530809e+03 -6.970866e+02
## NO2_Concentration -6.891073e+06 1.499830e+07
## gdp.cap -1.539392e-02 -7.851914e-04
## pop.density -3.077420e-01 -3.762088e-02
## med.age 4.665217e+01 7.812781e+01
#Function for multivariate analysis by Super.region.
cases.NO2 <- function(x) {
covid.NO2.df %>%
filter(Super.region == x) %>%
ggplot(aes(x = NO2_Concentration, y = totcases.mil)) +
geom_point(color = "#333aff") +
geom_smooth(color = "red") +
geom_smooth(method = "lm", color = "purple") +
theme_bw() +
labs(x = "NO2 Concentration (mol/m^2)", y = "Total COVID-19 Cases per Million People") +
labs(title = paste0("COVID-19 Cases per Million People in ", (Super.region = x), " vs. NO2 Concentration"))
}
NO2.lm.cases.reg <- function(x) {
covid.NO2.df %>%
filter(Super.region == x) %>%
lm(totcases.mil ~ NO2_Concentration + gdp.cap + pop.density + med.age,.) %>%
summary.lm()
} #Function for linear regression statistics to be included in for loop below.
for (i in regions.list) {
print(cases.NO2(i))
print(NO2.lm.cases.reg(i))
} #Loops function for continents of interest.

##
## Call:
## lm(formula = totcases.mil ~ NO2_Concentration + gdp.cap + pop.density +
## med.age, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -80918 -20637 11757 21503 56252
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.415e+05 6.915e+04 2.046 0.0506 .
## NO2_Concentration 6.753e+08 4.508e+08 1.498 0.1457
## gdp.cap -2.958e-01 4.276e-01 -0.692 0.4950
## pop.density -3.902e+00 5.323e+00 -0.733 0.4699
## med.age -2.064e+03 1.714e+03 -1.204 0.2391
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 37200 on 27 degrees of freedom
## (2 observations deleted due to missingness)
## Multiple R-squared: 0.1368, Adjusted R-squared: 0.008908
## F-statistic: 1.07 on 4 and 27 DF, p-value: 0.3908

##
## Call:
## lm(formula = totcases.mil ~ NO2_Concentration + gdp.cap + pop.density +
## med.age, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -36446 -9842 98 11484 54489
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -1.364e+05 6.274e+04 -2.174 0.040781 *
## NO2_Concentration 2.462e+09 1.499e+09 1.642 0.114759
## gdp.cap -1.129e+00 9.615e-01 -1.174 0.252926
## pop.density -1.453e+02 3.437e+01 -4.228 0.000346 ***
## med.age 5.968e+03 2.104e+03 2.837 0.009595 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 20580 on 22 degrees of freedom
## (4 observations deleted due to missingness)
## Multiple R-squared: 0.4785, Adjusted R-squared: 0.3837
## F-statistic: 5.046 on 4 and 22 DF, p-value: 0.004862

##
## Call:
## lm(formula = totcases.mil ~ NO2_Concentration + gdp.cap + pop.density +
## med.age, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -12928 -5002 -554 2599 30947
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -4.130e+04 1.378e+04 -2.996 0.00486 **
## NO2_Concentration -4.610e+08 3.222e+08 -1.431 0.16091
## gdp.cap 2.543e-01 3.588e-01 0.709 0.48300
## pop.density -5.393e+00 1.110e+01 -0.486 0.62984
## med.age 2.794e+03 6.085e+02 4.592 4.94e-05 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 7897 on 37 degrees of freedom
## (2 observations deleted due to missingness)
## Multiple R-squared: 0.5783, Adjusted R-squared: 0.5327
## F-statistic: 12.69 on 4 and 37 DF, p-value: 1.35e-06

##
## Call:
## lm(formula = totcases.mil ~ NO2_Concentration + gdp.cap + pop.density +
## med.age, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -28226 -10085 -1834 7016 51322
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -2.839e+04 2.766e+04 -1.026 0.320947
## NO2_Concentration 6.601e+08 5.310e+08 1.243 0.232937
## gdp.cap 3.284e-01 1.977e-01 1.661 0.117453
## pop.density 5.675e+01 1.162e+01 4.886 0.000198 ***
## med.age 1.318e+03 1.058e+03 1.245 0.232072
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 20020 on 15 degrees of freedom
## (1 observation deleted due to missingness)
## Multiple R-squared: 0.7965, Adjusted R-squared: 0.7423
## F-statistic: 14.68 on 4 and 15 DF, p-value: 4.54e-05

##
## Call:
## lm(formula = totcases.mil ~ NO2_Concentration + gdp.cap + pop.density +
## med.age, data = .)
##
## Residuals:
## ALL 5 residuals are 0: no residual degrees of freedom!
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -2.033e+06 NaN NaN NaN
## NO2_Concentration -8.654e+10 NaN NaN NaN
## gdp.cap -1.565e+02 NaN NaN NaN
## pop.density 1.933e+02 NaN NaN NaN
## med.age 2.022e+05 NaN NaN NaN
##
## Residual standard error: NaN on 0 degrees of freedom
## Multiple R-squared: 1, Adjusted R-squared: NaN
## F-statistic: NaN on 4 and 0 DF, p-value: NA

##
## Call:
## lm(formula = totcases.mil ~ NO2_Concentration + gdp.cap + pop.density +
## med.age, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -69519 -7960 -2246 4542 88232
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.202e+04 4.154e+04 0.289 0.7761
## NO2_Concentration -1.175e+09 1.168e+09 -1.006 0.3293
## gdp.cap 3.167e+00 1.454e+00 2.178 0.0447 *
## pop.density 5.813e+01 2.509e+01 2.317 0.0341 *
## med.age -8.473e+02 2.107e+03 -0.402 0.6929
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 31640 on 16 degrees of freedom
## (7 observations deleted due to missingness)
## Multiple R-squared: 0.5774, Adjusted R-squared: 0.4718
## F-statistic: 5.465 on 4 and 16 DF, p-value: 0.005715

##
## Call:
## lm(formula = totcases.mil ~ NO2_Concentration + gdp.cap + pop.density +
## med.age, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -32404 -21359 -7186 14258 90747
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -8.667e+04 4.108e+04 -2.110 0.0460 *
## NO2_Concentration 8.479e+08 1.654e+09 0.513 0.6130
## gdp.cap 5.136e-01 9.481e-01 0.542 0.5932
## pop.density 1.954e+01 2.755e+02 0.071 0.9441
## med.age 3.267e+03 1.374e+03 2.377 0.0262 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 30220 on 23 degrees of freedom
## (1 observation deleted due to missingness)
## Multiple R-squared: 0.4975, Adjusted R-squared: 0.4101
## F-statistic: 5.693 on 4 and 23 DF, p-value: 0.002456
deaths.NO2 <- function(x) {
covid.NO2.df %>%
filter(Super.region == x) %>%
ggplot(aes(x = NO2_Concentration, y = totdeaths.mil)) +
geom_point(color = "#333aff") +
geom_smooth(color = "red") +
geom_smooth(method = "lm", color = "purple") +
theme_bw() +
labs(x = "NO2 Concentration (mol/m^2)", y = "Total COVID-19 Deaths per Million People") +
labs(title = paste0("COVID-19 Deaths per Million People in ", (Super.region = x), " vs. NO2 Concentration"))
}
NO2.lm.deaths.reg <- function(x) {
covid.NO2.df %>%
filter(Super.region == x) %>%
lm(totdeaths.mil ~ NO2_Concentration + gdp.cap + pop.density + med.age,.) %>%
summary.lm() #Function for linear regression statistics to be included in for loop below.
}
for (i in regions.list) {
print(deaths.NO2(i))
print(NO2.lm.deaths.reg(i))
} #Loops function for continents of interest.

##
## Call:
## lm(formula = totdeaths.mil ~ NO2_Concentration + gdp.cap + pop.density +
## med.age, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1311.58 -566.71 9.46 532.00 1056.38
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.027e+03 1.346e+03 0.762 0.452
## NO2_Concentration 5.949e+06 8.777e+06 0.678 0.504
## gdp.cap -1.140e-02 8.326e-03 -1.369 0.182
## pop.density -7.383e-02 1.037e-01 -0.712 0.482
## med.age 8.725e+00 3.338e+01 0.261 0.796
##
## Residual standard error: 724.2 on 27 degrees of freedom
## (2 observations deleted due to missingness)
## Multiple R-squared: 0.1443, Adjusted R-squared: 0.0175
## F-statistic: 1.138 on 4 and 27 DF, p-value: 0.3598

##
## Call:
## lm(formula = totdeaths.mil ~ NO2_Concentration + gdp.cap + pop.density +
## med.age, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1308.9 -446.6 -12.6 258.7 4441.0
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -2.529e+03 3.356e+03 -0.753 0.4592
## NO2_Concentration 4.585e+07 8.021e+07 0.572 0.5733
## gdp.cap -3.965e-02 5.143e-02 -0.771 0.4490
## pop.density -4.825e+00 1.839e+00 -2.624 0.0155 *
## med.age 1.417e+02 1.125e+02 1.259 0.2212
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 1101 on 22 degrees of freedom
## (4 observations deleted due to missingness)
## Multiple R-squared: 0.2587, Adjusted R-squared: 0.1239
## F-statistic: 1.919 on 4 and 22 DF, p-value: 0.1428

##
## Call:
## lm(formula = totdeaths.mil ~ NO2_Concentration + gdp.cap + pop.density +
## med.age, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -245.62 -64.36 -21.13 51.06 483.56
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -9.329e+02 2.373e+02 -3.931 0.000357 ***
## NO2_Concentration 1.203e+06 5.549e+06 0.217 0.829502
## gdp.cap 1.500e-03 6.179e-03 0.243 0.809558
## pop.density -4.707e-02 1.911e-01 -0.246 0.806802
## med.age 5.193e+01 1.048e+01 4.956 1.61e-05 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 136 on 37 degrees of freedom
## (2 observations deleted due to missingness)
## Multiple R-squared: 0.5583, Adjusted R-squared: 0.5105
## F-statistic: 11.69 on 4 and 37 DF, p-value: 3.087e-06

##
## Call:
## lm(formula = totdeaths.mil ~ NO2_Concentration + gdp.cap + pop.density +
## med.age, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -386.42 -167.92 -62.21 131.12 585.64
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -7.698e+02 4.065e+02 -1.894 0.0777 .
## NO2_Concentration 1.645e+07 7.804e+06 2.108 0.0522 .
## gdp.cap -8.021e-03 2.906e-03 -2.760 0.0146 *
## pop.density 1.067e-01 1.707e-01 0.625 0.5413
## med.age 3.954e+01 1.556e+01 2.542 0.0226 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 294.3 on 15 degrees of freedom
## (1 observation deleted due to missingness)
## Multiple R-squared: 0.5256, Adjusted R-squared: 0.3991
## F-statistic: 4.154 on 4 and 15 DF, p-value: 0.01841

##
## Call:
## lm(formula = totdeaths.mil ~ NO2_Concentration + gdp.cap + pop.density +
## med.age, data = .)
##
## Residuals:
## ALL 5 residuals are 0: no residual degrees of freedom!
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -2.834e+04 NaN NaN NaN
## NO2_Concentration -1.223e+09 NaN NaN NaN
## gdp.cap -2.207e+00 NaN NaN NaN
## pop.density 2.771e+00 NaN NaN NaN
## med.age 2.841e+03 NaN NaN NaN
##
## Residual standard error: NaN on 0 degrees of freedom
## Multiple R-squared: 1, Adjusted R-squared: NaN
## F-statistic: NaN on 4 and 0 DF, p-value: NA

##
## Call:
## lm(formula = totdeaths.mil ~ NO2_Concentration + gdp.cap + pop.density +
## med.age, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -284.60 -51.08 7.73 68.13 335.99
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 7.906e+01 2.084e+02 0.379 0.711
## NO2_Concentration -7.100e+06 6.049e+06 -1.174 0.263
## gdp.cap 1.282e-02 7.330e-03 1.749 0.106
## pop.density 9.886e-02 1.210e-01 0.817 0.430
## med.age -1.136e+00 1.019e+01 -0.112 0.913
##
## Residual standard error: 150.4 on 12 degrees of freedom
## (11 observations deleted due to missingness)
## Multiple R-squared: 0.4931, Adjusted R-squared: 0.3242
## F-statistic: 2.919 on 4 and 12 DF, p-value: 0.06712

##
## Call:
## lm(formula = totdeaths.mil ~ NO2_Concentration + gdp.cap + pop.density +
## med.age, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1333.94 -396.57 5.37 308.10 1184.40
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -3.037e+03 8.427e+02 -3.603 0.00150 **
## NO2_Concentration 4.754e+07 3.392e+07 1.401 0.17447
## gdp.cap -1.507e-02 1.945e-02 -0.775 0.44625
## pop.density 7.823e-01 5.651e+00 0.138 0.89111
## med.age 9.481e+01 2.819e+01 3.363 0.00269 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 619.8 on 23 degrees of freedom
## (1 observation deleted due to missingness)
## Multiple R-squared: 0.642, Adjusted R-squared: 0.5797
## F-statistic: 10.31 on 4 and 23 DF, p-value: 6.214e-05
Multivariate graphs of COVID outcomes vs weighted NO2 concentrations.
#Weighted NO2 concentration vs COVID cases.
ggplot(data = weighted.covid.NO2.df, aes(x = pop.weighted.NO2, y = totcases.mil)) +
geom_point(color = "#333aff", alpha = 1) +
geom_smooth(color = "red") +
geom_smooth(method = "lm", color = "purple") +
theme_bw() +
labs(x = "NO2 Concentration (mol/m^2)", y = "Total COVID-19 Cases per Million People") +
labs(title = "World COVID-19 Cases per Million People vs. Population Weighted NO2 Concentration")

cor(weighted.covid.NO2.df$totcases.mil, weighted.covid.NO2.df$pop.weighted.NO2, use = "complete.obs")
## [1] 0.1993439
NO2.lm.cases <- lm(totcases.mil ~ pop.weighted.NO2 + gdp.cap + pop.density + med.age, data = weighted.covid.NO2.df)
summary.lm(NO2.lm.cases)
##
## Call:
## lm(formula = totcases.mil ~ pop.weighted.NO2 + gdp.cap + pop.density +
## med.age, data = weighted.covid.NO2.df)
##
## Residuals:
## Min 1Q Median 3Q Max
## -77235 -14971 -4383 9250 121334
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -3.896e+04 9.102e+03 -4.280 3.10e-05 ***
## pop.weighted.NO2 4.978e+11 1.386e+12 0.359 0.7200
## gdp.cap 2.795e-01 1.658e-01 1.686 0.0937 .
## pop.density -6.937e+00 3.105e+00 -2.234 0.0268 *
## med.age 2.314e+03 3.481e+02 6.647 3.86e-10 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 31260 on 171 degrees of freedom
## (76 observations deleted due to missingness)
## Multiple R-squared: 0.3888, Adjusted R-squared: 0.3745
## F-statistic: 27.19 on 4 and 171 DF, p-value: < 2.2e-16
confint(NO2.lm.cases) #Summary statistics for linear fit.
## 2.5 % 97.5 %
## (Intercept) -5.692563e+04 -2.099168e+04
## pop.weighted.NO2 -2.238674e+12 3.234279e+12
## gdp.cap -4.779897e-02 6.068672e-01
## pop.density -1.306547e+01 -8.078500e-01
## med.age 1.626715e+03 3.001059e+03
#Weighted NO2 concentration vs COVID deaths.
ggplot(data = weighted.covid.NO2.df, aes(x = pop.weighted.NO2, y = totdeaths.mil)) +
geom_point(color = "#333aff", alpha = 1) +
geom_smooth(color = "red") +
geom_smooth(method = "lm", color = "purple") +
theme_bw() +
labs(x = "NO2 Concentration (mol/m^2)", y = "Total COVID-19 Deaths per Million People") +
labs(title = "World COVID-19 Deaths per Million People vs. Population Weighted NO2 Concentration")

cor(weighted.covid.NO2.df$totdeaths.mil, weighted.covid.NO2.df$pop.weighted.NO2, use = "complete.obs")
## [1] 0.1763399
NO2.lm.deaths <- lm(totdeaths.mil ~ pop.weighted.NO2 + gdp.cap + pop.density + med.age, data = weighted.covid.NO2.df,)
summary.lm(NO2.lm.deaths)
##
## Call:
## lm(formula = totdeaths.mil ~ pop.weighted.NO2 + gdp.cap + pop.density +
## med.age, data = weighted.covid.NO2.df)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1538.1 -355.5 -80.0 207.9 5168.1
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -1.092e+03 2.079e+02 -5.254 4.49e-07 ***
## pop.weighted.NO2 1.679e+10 3.155e+10 0.532 0.5953
## gdp.cap -8.183e-03 3.746e-03 -2.185 0.0303 *
## pop.density -1.614e-01 7.013e-02 -2.302 0.0226 *
## med.age 6.303e+01 7.875e+00 8.004 1.94e-13 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 705.9 on 167 degrees of freedom
## (80 observations deleted due to missingness)
## Multiple R-squared: 0.3384, Adjusted R-squared: 0.3225
## F-statistic: 21.35 on 4 and 167 DF, p-value: 3.075e-14
confint(NO2.lm.deaths) #Summary statistics for linear fit.
## 2.5 % 97.5 %
## (Intercept) -1.502670e+03 -6.817877e+02
## pop.weighted.NO2 -4.550270e+10 7.908650e+10
## gdp.cap -1.557822e-02 -7.878836e-04
## pop.density -2.998452e-01 -2.295150e-02
## med.age 4.748218e+01 7.857575e+01
#Function for multivariate analysis by Super.region.
cases.NO2 <- function(x) {
weighted.covid.NO2.df %>%
filter(Super.region == x) %>%
ggplot(aes(x = pop.weighted.NO2, y = totcases.mil)) +
geom_point(color = "#333aff") +
geom_smooth(color = "red") +
geom_smooth(method = "lm", color = "purple") +
theme_bw() +
labs(x = "NO2 Concentration (mol/m^2)", y = "Total COVID-19 Cases per Million People") +
labs(title = paste0("COVID-19 Cases per Million People in ", (Super.region = x), " vs. Population Weighted NO2 Concentration"))
}
NO2.lm.cases.reg <- function(x) {
weighted.covid.NO2.df %>%
filter(Super.region == x) %>%
lm(totcases.mil ~ pop.weighted.NO2 + gdp.cap + pop.density + med.age,.) %>%
summary.lm()
} #Function for linear regression statistics to be included in for loop below.
for (i in regions.list) {
print(cases.NO2(i))
print(NO2.lm.cases.reg(i))
} #Loops function for continents of interest.

##
## Call:
## lm(formula = totcases.mil ~ pop.weighted.NO2 + gdp.cap + pop.density +
## med.age, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -63683 -26278 12377 24428 65629
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.102e+05 6.927e+04 1.591 0.123
## pop.weighted.NO2 1.121e+12 3.965e+12 0.283 0.780
## gdp.cap -2.249e-01 4.425e-01 -0.508 0.615
## pop.density -3.908e+00 5.711e+00 -0.684 0.500
## med.age -1.030e+03 1.711e+03 -0.602 0.552
##
## Residual standard error: 38650 on 27 degrees of freedom
## (2 observations deleted due to missingness)
## Multiple R-squared: 0.06781, Adjusted R-squared: -0.0703
## F-statistic: 0.491 on 4 and 27 DF, p-value: 0.7423

##
## Call:
## lm(formula = totcases.mil ~ pop.weighted.NO2 + gdp.cap + pop.density +
## med.age, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -39068 -9133 1164 9581 48875
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -1.157e+05 4.694e+04 -2.465 0.021973 *
## pop.weighted.NO2 1.249e+13 5.813e+12 2.148 0.042948 *
## gdp.cap -1.188e+00 9.161e-01 -1.297 0.208219
## pop.density -1.291e+02 2.959e+01 -4.364 0.000248 ***
## med.age 5.776e+03 1.835e+03 3.147 0.004680 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 19820 on 22 degrees of freedom
## (4 observations deleted due to missingness)
## Multiple R-squared: 0.5161, Adjusted R-squared: 0.4281
## F-statistic: 5.865 on 4 and 22 DF, p-value: 0.002276

##
## Call:
## lm(formula = totcases.mil ~ pop.weighted.NO2 + gdp.cap + pop.density +
## med.age, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -12682 -4271 -1596 3197 32440
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -5.181e+04 1.213e+04 -4.272 0.00013 ***
## pop.weighted.NO2 -7.071e+11 1.859e+12 -0.380 0.70582
## gdp.cap 1.171e-01 3.547e-01 0.330 0.74315
## pop.density -3.858e+00 1.158e+01 -0.333 0.74092
## med.age 3.013e+03 6.075e+02 4.960 1.6e-05 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 8096 on 37 degrees of freedom
## (2 observations deleted due to missingness)
## Multiple R-squared: 0.5567, Adjusted R-squared: 0.5088
## F-statistic: 11.62 on 4 and 37 DF, p-value: 3.286e-06

##
## Call:
## lm(formula = totcases.mil ~ pop.weighted.NO2 + gdp.cap + pop.density +
## med.age, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -30024 -10681 -136 11610 50896
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -2.071e+04 2.837e+04 -0.730 0.477
## pop.weighted.NO2 1.822e+11 1.474e+12 0.124 0.903
## gdp.cap 3.569e-01 2.139e-01 1.668 0.116
## pop.density 6.330e+01 1.093e+01 5.790 3.57e-05 ***
## med.age 1.434e+03 1.107e+03 1.295 0.215
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 21020 on 15 degrees of freedom
## (1 observation deleted due to missingness)
## Multiple R-squared: 0.7758, Adjusted R-squared: 0.716
## F-statistic: 12.98 on 4 and 15 DF, p-value: 9.189e-05

##
## Call:
## lm(formula = totcases.mil ~ pop.weighted.NO2 + gdp.cap + pop.density +
## med.age, data = .)
##
## Residuals:
## ALL 5 residuals are 0: no residual degrees of freedom!
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -1.913e+05 NaN NaN NaN
## pop.weighted.NO2 2.886e+13 NaN NaN NaN
## gdp.cap 1.277e+01 NaN NaN NaN
## pop.density 3.630e+01 NaN NaN NaN
## med.age 8.563e+02 NaN NaN NaN
##
## Residual standard error: NaN on 0 degrees of freedom
## Multiple R-squared: 1, Adjusted R-squared: NaN
## F-statistic: NaN on 4 and 0 DF, p-value: NA

##
## Call:
## lm(formula = totcases.mil ~ pop.weighted.NO2 + gdp.cap + pop.density +
## med.age, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -72601 -8795 1065 6032 84944
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 9.763e+03 4.106e+04 0.238 0.8151
## pop.weighted.NO2 -6.330e+12 5.451e+12 -1.161 0.2626
## gdp.cap 3.498e+00 1.362e+00 2.568 0.0206 *
## pop.density 5.596e+01 2.514e+01 2.226 0.0407 *
## med.age -1.111e+03 1.861e+03 -0.597 0.5587
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 31330 on 16 degrees of freedom
## (7 observations deleted due to missingness)
## Multiple R-squared: 0.5856, Adjusted R-squared: 0.482
## F-statistic: 5.653 on 4 and 16 DF, p-value: 0.004944

##
## Call:
## lm(formula = totcases.mil ~ pop.weighted.NO2 + gdp.cap + pop.density +
## med.age, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -36674 -20261 -6478 15784 91154
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -8.948e+04 4.153e+04 -2.155 0.0419 *
## pop.weighted.NO2 2.303e+12 6.795e+12 0.339 0.7377
## gdp.cap 5.984e-01 9.407e-01 0.636 0.5310
## pop.density 1.212e+02 1.666e+02 0.727 0.4743
## med.age 3.421e+03 1.332e+03 2.568 0.0172 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 30310 on 23 degrees of freedom
## (1 observation deleted due to missingness)
## Multiple R-squared: 0.4943, Adjusted R-squared: 0.4064
## F-statistic: 5.621 on 4 and 23 DF, p-value: 0.002629
deaths.NO2 <- function(x) {
weighted.covid.NO2.df %>%
filter(Super.region == x) %>%
ggplot(aes(x = pop.weighted.NO2, y = totdeaths.mil)) +
geom_point(color = "#333aff") +
geom_smooth(color = "red") +
geom_smooth(method = "lm", color = "purple") +
theme_bw() +
labs(x = "NO2 Concentration (mol/m^2)", y = "Total COVID-19 Deaths per Million People") +
labs(title = paste0("COVID-19 Deaths per Million People in ", (Super.region = x), " vs. Population Weighted NO2 Concentration"))
}
NO2.lm.deaths.reg <- function(x) {
weighted.covid.NO2.df %>%
filter(Super.region == x) %>%
lm(totdeaths.mil ~ pop.weighted.NO2 + gdp.cap + pop.density + med.age,.) %>%
summary.lm() #Function for linear regression statistics to be included in for loop below.
}
for (i in regions.list) {
print(deaths.NO2(i))
print(NO2.lm.deaths.reg(i))
} #Loops function for continents of interest.

##
## Call:
## lm(formula = totdeaths.mil ~ pop.weighted.NO2 + gdp.cap + pop.density +
## med.age, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1110.25 -598.46 2.29 522.02 1135.85
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 7.560e+02 1.308e+03 0.578 0.568
## pop.weighted.NO2 1.108e+10 7.489e+10 0.148 0.884
## gdp.cap -1.076e-02 8.358e-03 -1.288 0.209
## pop.density -7.344e-02 1.079e-01 -0.681 0.502
## med.age 1.762e+01 3.231e+01 0.545 0.590
##
## Residual standard error: 730.1 on 27 degrees of freedom
## (2 observations deleted due to missingness)
## Multiple R-squared: 0.1304, Adjusted R-squared: 0.001588
## F-statistic: 1.012 on 4 and 27 DF, p-value: 0.4185

##
## Call:
## lm(formula = totdeaths.mil ~ pop.weighted.NO2 + gdp.cap + pop.density +
## med.age, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1363.0 -363.4 -183.6 225.8 4360.9
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -2.693e+03 2.557e+03 -1.053 0.30367
## pop.weighted.NO2 3.474e+11 3.166e+11 1.097 0.28446
## gdp.cap -4.590e-02 4.990e-02 -0.920 0.36764
## pop.density -4.620e+00 1.612e+00 -2.866 0.00897 **
## med.age 1.558e+02 9.998e+01 1.558 0.13340
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 1080 on 22 degrees of freedom
## (4 observations deleted due to missingness)
## Multiple R-squared: 0.2867, Adjusted R-squared: 0.157
## F-statistic: 2.211 on 4 and 22 DF, p-value: 0.101

##
## Call:
## lm(formula = totdeaths.mil ~ pop.weighted.NO2 + gdp.cap + pop.density +
## med.age, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -216.20 -63.95 -15.86 42.52 349.34
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -1.099e+03 1.895e+02 -5.801 1.17e-06 ***
## pop.weighted.NO2 7.003e+10 2.904e+10 2.412 0.021 *
## gdp.cap -3.397e-04 5.541e-03 -0.061 0.951
## pop.density 5.389e-02 1.809e-01 0.298 0.767
## med.age 5.613e+01 9.491e+00 5.914 8.21e-07 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 126.5 on 37 degrees of freedom
## (2 observations deleted due to missingness)
## Multiple R-squared: 0.6178, Adjusted R-squared: 0.5765
## F-statistic: 14.95 on 4 and 37 DF, p-value: 2.328e-07

##
## Call:
## lm(formula = totdeaths.mil ~ pop.weighted.NO2 + gdp.cap + pop.density +
## med.age, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -474.34 -169.86 -21.34 173.70 604.48
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -6.318e+02 4.240e+02 -1.490 0.1570
## pop.weighted.NO2 3.167e+10 2.202e+10 1.438 0.1709
## gdp.cap -8.418e-03 3.197e-03 -2.633 0.0188 *
## pop.density 2.847e-01 1.634e-01 1.742 0.1019
## med.age 4.244e+01 1.654e+01 2.566 0.0215 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 314.1 on 15 degrees of freedom
## (1 observation deleted due to missingness)
## Multiple R-squared: 0.4595, Adjusted R-squared: 0.3154
## F-statistic: 3.188 on 4 and 15 DF, p-value: 0.04403

##
## Call:
## lm(formula = totdeaths.mil ~ pop.weighted.NO2 + gdp.cap + pop.density +
## med.age, data = .)
##
## Residuals:
## ALL 5 residuals are 0: no residual degrees of freedom!
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -2.317e+03 NaN NaN NaN
## pop.weighted.NO2 4.078e+11 NaN NaN NaN
## gdp.cap 1.846e-01 NaN NaN NaN
## pop.density 5.531e-01 NaN NaN NaN
## med.age -3.957e+00 NaN NaN NaN
##
## Residual standard error: NaN on 0 degrees of freedom
## Multiple R-squared: 1, Adjusted R-squared: NaN
## F-statistic: NaN on 4 and 0 DF, p-value: NA

##
## Call:
## lm(formula = totdeaths.mil ~ pop.weighted.NO2 + gdp.cap + pop.density +
## med.age, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -295.53 -74.64 -10.78 52.95 324.09
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 6.662e+01 2.099e+02 0.317 0.7565
## pop.weighted.NO2 -3.257e+10 2.673e+10 -1.219 0.2464
## gdp.cap 1.529e-02 6.695e-03 2.284 0.0414 *
## pop.density 9.516e-02 1.211e-01 0.786 0.4473
## med.age -3.381e+00 9.041e+00 -0.374 0.7149
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 149.8 on 12 degrees of freedom
## (11 observations deleted due to missingness)
## Multiple R-squared: 0.4972, Adjusted R-squared: 0.3296
## F-statistic: 2.966 on 4 and 12 DF, p-value: 0.06438

##
## Call:
## lm(formula = totdeaths.mil ~ pop.weighted.NO2 + gdp.cap + pop.density +
## med.age, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1125.3 -391.5 -114.2 302.0 1216.0
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -3.104e+03 8.845e+02 -3.510 0.00188 **
## pop.weighted.NO2 1.675e+10 1.447e+11 0.116 0.90887
## gdp.cap -3.280e-03 2.004e-02 -0.164 0.87139
## pop.density 7.099e+00 3.548e+00 2.001 0.05732 .
## med.age 1.052e+02 2.837e+01 3.707 0.00116 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 645.5 on 23 degrees of freedom
## (1 observation deleted due to missingness)
## Multiple R-squared: 0.6116, Adjusted R-squared: 0.5441
## F-statistic: 9.056 on 4 and 23 DF, p-value: 0.0001518
fatality.rate.NO2 <- function(x) {
weighted.covid.NO2.df %>%
filter(Super.region == x) %>%
ggplot(aes(x = pop.weighted.NO2, y = case.fatality.rate)) +
geom_point(color = "#333aff") +
geom_smooth(color = "red") +
geom_smooth(method = "lm", color = "purple") +
theme_bw() +
labs(x = "NO2 Concentration (mol/m^2)", y = "Total COVID-19 Deaths per Million People") +
labs(title = paste0("COVID-19 Deaths per Million People in ", (Super.region = x), " vs. Population Weighted NO2 Concentration"))
}
NO2.lm.fatality.reg <- function(x) {
weighted.covid.NO2.df %>%
filter(Super.region == x) %>%
lm(case.fatality.rate ~ pop.weighted.NO2 + gdp.cap + pop.density + med.age,.) %>%
summary.lm() #Function for linear regression statistics to be included in for loop below.
}
for (i in regions.list) {
print(fatality.rate.NO2(i))
print(NO2.lm.fatality.reg(i))
} #Loops function for continents of interest.

##
## Call:
## lm(formula = case.fatality.rate ~ pop.weighted.NO2 + gdp.cap +
## pop.density + med.age, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.0110282 -0.0041978 0.0000132 0.0047030 0.0147584
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -1.920e-03 1.209e-02 -0.159 0.8750
## pop.weighted.NO2 -2.465e+04 6.923e+05 -0.036 0.9719
## gdp.cap -1.234e-07 7.726e-08 -1.597 0.1219
## pop.density -1.622e-06 9.971e-07 -1.627 0.1154
## med.age 5.934e-04 2.987e-04 1.987 0.0572 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.006749 on 27 degrees of freedom
## (2 observations deleted due to missingness)
## Multiple R-squared: 0.3271, Adjusted R-squared: 0.2274
## F-statistic: 3.281 on 4 and 27 DF, p-value: 0.02577

##
## Call:
## lm(formula = case.fatality.rate ~ pop.weighted.NO2 + gdp.cap +
## pop.density + med.age, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.022873 -0.008812 -0.005646 0.003473 0.060924
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 3.035e-02 5.049e-02 0.601 0.554
## pop.weighted.NO2 4.130e+06 6.252e+06 0.661 0.516
## gdp.cap 7.909e-09 9.854e-07 0.008 0.994
## pop.density -4.125e-05 3.182e-05 -1.296 0.208
## med.age -5.371e-06 1.974e-03 -0.003 0.998
##
## Residual standard error: 0.02132 on 22 degrees of freedom
## (4 observations deleted due to missingness)
## Multiple R-squared: 0.1354, Adjusted R-squared: -0.02178
## F-statistic: 0.8614 on 4 and 22 DF, p-value: 0.5023

##
## Call:
## lm(formula = case.fatality.rate ~ pop.weighted.NO2 + gdp.cap +
## pop.density + med.age, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.016674 -0.007111 -0.001484 0.007006 0.022902
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 2.306e-02 1.541e-02 1.497 0.143
## pop.weighted.NO2 8.546e+05 2.361e+06 0.362 0.719
## gdp.cap -3.823e-07 4.505e-07 -0.849 0.402
## pop.density -1.137e-05 1.471e-05 -0.773 0.444
## med.age -1.533e-04 7.717e-04 -0.199 0.844
##
## Residual standard error: 0.01028 on 37 degrees of freedom
## (2 observations deleted due to missingness)
## Multiple R-squared: 0.0541, Adjusted R-squared: -0.04816
## F-statistic: 0.529 on 4 and 37 DF, p-value: 0.7151

##
## Call:
## lm(formula = case.fatality.rate ~ pop.weighted.NO2 + gdp.cap +
## pop.density + med.age, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.045443 -0.014412 -0.001374 0.008952 0.135152
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.251e-01 5.582e-02 2.241 0.0406 *
## pop.weighted.NO2 -1.800e+05 2.899e+06 -0.062 0.9513
## gdp.cap -2.374e-07 4.209e-07 -0.564 0.5810
## pop.density -1.406e-05 2.151e-05 -0.654 0.5233
## med.age -3.051e-03 2.177e-03 -1.401 0.1814
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.04135 on 15 degrees of freedom
## (1 observation deleted due to missingness)
## Multiple R-squared: 0.2886, Adjusted R-squared: 0.09894
## F-statistic: 1.522 on 4 and 15 DF, p-value: 0.2461

##
## Call:
## lm(formula = case.fatality.rate ~ pop.weighted.NO2 + gdp.cap +
## pop.density + med.age, data = .)
##
## Residuals:
## ALL 5 residuals are 0: no residual degrees of freedom!
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 4.268e-02 NaN NaN NaN
## pop.weighted.NO2 1.367e+07 NaN NaN NaN
## gdp.cap 9.091e-06 NaN NaN NaN
## pop.density 3.624e-05 NaN NaN NaN
## med.age -5.222e-03 NaN NaN NaN
##
## Residual standard error: NaN on 0 degrees of freedom
## Multiple R-squared: 1, Adjusted R-squared: NaN
## F-statistic: NaN on 4 and 0 DF, p-value: NA

##
## Call:
## lm(formula = case.fatality.rate ~ pop.weighted.NO2 + gdp.cap +
## pop.density + med.age, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.038439 -0.031820 -0.012866 0.006726 0.200574
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 5.375e-02 9.051e-02 0.594 0.564
## pop.weighted.NO2 -1.716e+06 1.152e+07 -0.149 0.884
## gdp.cap -1.943e-06 2.886e-06 -0.673 0.514
## pop.density -2.409e-05 5.222e-05 -0.461 0.653
## med.age 1.009e-04 3.898e-03 0.026 0.980
##
## Residual standard error: 0.06459 on 12 degrees of freedom
## (11 observations deleted due to missingness)
## Multiple R-squared: 0.09934, Adjusted R-squared: -0.2009
## F-statistic: 0.3309 on 4 and 12 DF, p-value: 0.8519

##
## Call:
## lm(formula = case.fatality.rate ~ pop.weighted.NO2 + gdp.cap +
## pop.density + med.age, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.015968 -0.004985 -0.002020 0.006135 0.020052
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -2.611e-02 1.295e-02 -2.016 0.0556 .
## pop.weighted.NO2 3.730e+05 2.119e+06 0.176 0.8618
## gdp.cap -3.885e-07 2.934e-07 -1.324 0.1985
## pop.density 5.305e-05 5.195e-05 1.021 0.3178
## med.age 1.257e-03 4.155e-04 3.027 0.0060 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.009454 on 23 degrees of freedom
## (1 observation deleted due to missingness)
## Multiple R-squared: 0.389, Adjusted R-squared: 0.2828
## F-statistic: 3.661 on 4 and 23 DF, p-value: 0.01895
####Analysis of high and low groups.
high <- data.frame("group" = rep("high", length.out = nrow(high.covid)))
high.covid <- cbind(high, high.covid)
low <- data.frame("group" = rep("low", length.out = nrow(low.covid)))
low.covid <- cbind(low, low.covid)
df.covid <- rbind(high.covid, low.covid)
#Boxplot of NO2 Concentrations by case groups.
ggplot(df.covid, aes(group,NO2_Concentration)) +
geom_boxplot() +
geom_jitter(color="red", size=0.4, alpha=0.9) +
labs(title = "NO2 Concentrations Grouped by COVID Case Levels", x = "Case Count Group", y = "NO2 Concentration (mol/m^2)") +
stat_compare_means(method = "t.test")

#Boxplot of weighted NO2 Concentrations by case groups.
ggplot(df.covid, aes(group,pop.weighted.NO2)) +
geom_boxplot() +
geom_jitter(color="red", size=0.4, alpha=0.9) +
labs(title = "Weighted NO2 Concentrations Grouped by COVID Case Levels", x = "Case Count Group", y = "Weighted NO2 Concentration") +
stat_compare_means(method = "t.test")

rm(df.covid)
high <- data.frame("group" = rep("high", length.out = nrow(high.NO2)))
high.NO2 <- cbind(high, high.NO2)
low <- data.frame("group" = rep("low", length.out = nrow(low.NO2)))
low.NO2<- cbind(low, low.NO2)
df.NO2 <- rbind(high.NO2, low.NO2)
#Boxplot of COVID cases by NO2 groups.
ggplot(df.NO2, aes(group,totcases.mil)) +
geom_boxplot() +
geom_jitter(color="red", size=0.4, alpha=0.9) +
labs(title = "COVID Cases per Million Grouped by NO2 Concentration Levels", x = "NO2 Concentration Group", y = "Cases per Million") +
stat_compare_means(method = "t.test")

#Boxplot of COVID deaths by NO2 groups.
ggplot(df.NO2, aes(group,totdeaths.mil)) +
geom_boxplot() +
geom_jitter(color="red", size=0.4, alpha=0.9) +
labs(title = "COVID Deaths per Million Grouped by NO2 Concentration Levels", x = "NO2 Concentration Group", y = "Deaths per Million") +
stat_compare_means(method = "t.test")

#Boxplot of COVID CFR by NO2 groups.
ggplot(df.NO2, aes(group,case.fatality.rate)) +
geom_boxplot() +
geom_jitter(color="red", size=0.4, alpha=0.9) +
labs(title = "COVID Case Fatality Rate Grouped by NO2 Concentration Levels", x = "NO2 Concentration Group", y = "Case Fatality Rate") +
stat_compare_means(method = "t.test")

Multivariate graphs of COVID outcomes vs weighted NO2 concentrations: NO2 group divisions.
#High NO2.
#Weighted NO2 concentration vs COVID cases.
ggplot(data = high.NO2, aes(x = pop.weighted.NO2, y = totcases.mil)) +
geom_point(color = "#333aff", alpha = 1) +
geom_smooth(color = "red") +
geom_smooth(method = "lm", color = "purple") +
theme_bw() +
labs(x = "NO2 Concentration (mol/m^2)", y = "Total COVID-19 Cases per Million People") +
labs(title = "High NO2: World COVID-19 Cases per Million vs. Population Weighted NO2 Concentration")

cor(high.NO2$totcases.mil, high.NO2$pop.weighted.NO2, use = "complete.obs")
## [1] 0.2886313
NO2.lm.cases <- lm(totcases.mil ~ pop.weighted.NO2 + gdp.cap + pop.density + med.age, data = high.NO2)
summary.lm(NO2.lm.cases)
##
## Call:
## lm(formula = totcases.mil ~ pop.weighted.NO2 + gdp.cap + pop.density +
## med.age, data = high.NO2)
##
## Residuals:
## Min 1Q Median 3Q Max
## -76727 -13474 -729 10953 96576
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -4.756e+04 1.156e+04 -4.115 8.19e-05 ***
## pop.weighted.NO2 2.652e+12 1.958e+12 1.355 0.179
## gdp.cap 7.028e-02 2.145e-01 0.328 0.744
## pop.density -2.700e+01 1.939e+01 -1.392 0.167
## med.age 2.573e+03 3.951e+02 6.514 3.36e-09 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 29680 on 96 degrees of freedom
## (2 observations deleted due to missingness)
## Multiple R-squared: 0.4708, Adjusted R-squared: 0.4488
## F-statistic: 21.35 on 4 and 96 DF, p-value: 1.276e-12
confint(NO2.lm.cases) #Summary statistics for linear fit.
## 2.5 % 97.5 %
## (Intercept) -7.049681e+04 -2.461428e+04
## pop.weighted.NO2 -1.233898e+12 6.537506e+12
## gdp.cap -3.554876e-01 4.960575e-01
## pop.density -6.547954e+01 1.148686e+01
## med.age 1.789196e+03 3.357565e+03
#Weighted NO2 concentration vs COVID deaths.
ggplot(data = high.NO2, aes(x = pop.weighted.NO2, y = totdeaths.mil)) +
geom_point(color = "#333aff", alpha = 1) +
geom_smooth(color = "red") +
geom_smooth(method = "lm", color = "purple") +
theme_bw() +
labs(x = "NO2 Concentration (mol/m^2)", y = "Total COVID-19 Deaths per Million People") +
labs(title = "High NO2: World COVID-19 Deaths per Million vs. Population Weighted NO2 Concentration")

cor(high.NO2$totdeaths.mil, high.NO2$pop.weighted.NO2, use = "complete.obs")
## [1] 0.1312395
NO2.lm.deaths <- lm(totdeaths.mil ~ pop.weighted.NO2 + gdp.cap + pop.density + med.age, data = high.NO2,)
summary.lm(NO2.lm.deaths)
##
## Call:
## lm(formula = totdeaths.mil ~ pop.weighted.NO2 + gdp.cap + pop.density +
## med.age, data = high.NO2)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1526.33 -367.45 -4.04 304.54 1539.45
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -1.249e+03 2.499e+02 -4.999 2.59e-06 ***
## pop.weighted.NO2 1.673e+10 4.233e+10 0.395 0.6936
## gdp.cap -1.032e-02 4.638e-03 -2.226 0.0284 *
## pop.density -7.161e-01 4.192e-01 -1.708 0.0908 .
## med.age 7.179e+01 8.543e+00 8.403 3.95e-13 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 641.8 on 96 degrees of freedom
## (2 observations deleted due to missingness)
## Multiple R-squared: 0.4747, Adjusted R-squared: 0.4528
## F-statistic: 21.69 on 4 and 96 DF, p-value: 9.057e-13
confint(NO2.lm.deaths) #Summary statistics for linear fit.
## 2.5 % 97.5 %
## (Intercept) -1.745562e+03 -7.533805e+02
## pop.weighted.NO2 -6.730038e+10 1.007516e+11
## gdp.cap -1.953092e-02 -1.116773e-03
## pop.density -1.548298e+00 1.160536e-01
## med.age 5.483057e+01 8.874559e+01
#Weighted NO2 concentration vs COVID CFR.
ggplot(data = high.NO2, aes(x = pop.weighted.NO2, y = case.fatality.rate)) +
geom_point(color = "#333aff", alpha = 1) +
geom_smooth(color = "red") +
geom_smooth(method = "lm", color = "purple") +
theme_bw() +
labs(x = "NO2 Concentration (mol/m^2)", y = "Case Fatality Rate") +
labs(title = "High NO2: COVID-19 Case Fatality Rate vs. Population Weighted NO2 Concentration")

cor(high.NO2$case.fatality.rate, high.NO2$pop.weighted.NO2, use = "complete.obs")
## [1] -0.04524874
NO2.lm.deaths <- lm(case.fatality.rate ~ pop.weighted.NO2 + gdp.cap + pop.density + med.age, data = high.NO2,)
summary.lm(NO2.lm.deaths)
##
## Call:
## lm(formula = case.fatality.rate ~ pop.weighted.NO2 + gdp.cap +
## pop.density + med.age, data = high.NO2)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.021998 -0.008000 -0.002776 0.005204 0.072438
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.649e-02 5.446e-03 3.028 0.00316 **
## pop.weighted.NO2 4.305e+05 9.223e+05 0.467 0.64170
## gdp.cap -1.995e-07 1.011e-07 -1.974 0.05125 .
## pop.density -1.030e-05 9.135e-06 -1.128 0.26221
## med.age 2.479e-04 1.861e-04 1.332 0.18605
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.01398 on 96 degrees of freedom
## (2 observations deleted due to missingness)
## Multiple R-squared: 0.04954, Adjusted R-squared: 0.009936
## F-statistic: 1.251 on 4 and 96 DF, p-value: 0.2948
confint(NO2.lm.deaths) #Summary statistics for linear fit.
## 2.5 % 97.5 %
## (Intercept) 5.680976e-03 2.729953e-02
## pop.weighted.NO2 -1.400284e+06 2.261384e+06
## gdp.cap -4.001154e-07 1.108712e-09
## pop.density -2.843434e-05 7.830066e-06
## med.age -1.215652e-04 6.174061e-04
#Function for multivariate analysis by Super.region.
cases.NO2 <- function(x) {
high.NO2 %>%
filter(Super.region == x) %>%
ggplot(aes(x = pop.weighted.NO2, y = totcases.mil)) +
geom_point(color = "#333aff") +
geom_smooth(color = "red") +
geom_smooth(method = "lm", color = "purple") +
theme_bw() +
labs(x = "NO2 Concentration (mol/m^2)", y = "Total COVID-19 Cases per Million People") +
labs(title = paste0("COVID-19 Cases per Million People in ", (Super.region = x), " vs. Population Weighted NO2 Concentration"))
}
NO2.lm.cases.reg <- function(x) {
high.NO2 %>%
filter(Super.region == x) %>%
lm(totcases.mil ~ pop.weighted.NO2 + gdp.cap + pop.density + med.age,.) %>%
summary.lm()
} #Function for linear regression statistics to be included in for loop below.
for (i in regions.list) {
print(cases.NO2(i))
print(NO2.lm.cases.reg(i))
} #Loops function for continents of interest.

##
## Call:
## lm(formula = totcases.mil ~ pop.weighted.NO2 + gdp.cap + pop.density +
## med.age, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -65602 -18514 6059 25655 47547
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.654e+05 7.329e+04 2.257 0.0367 *
## pop.weighted.NO2 1.919e+12 6.745e+12 0.285 0.7793
## gdp.cap -4.519e-01 6.746e-01 -0.670 0.5115
## pop.density -2.695e+00 6.568e+01 -0.041 0.9677
## med.age -2.148e+03 1.820e+03 -1.180 0.2534
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 35880 on 18 degrees of freedom
## Multiple R-squared: 0.1035, Adjusted R-squared: -0.09568
## F-statistic: 0.5197 on 4 and 18 DF, p-value: 0.7224

##
## Call:
## lm(formula = totcases.mil ~ pop.weighted.NO2 + gdp.cap + pop.density +
## med.age, data = .)
##
## Residuals:
## 1 2 3 4 5 6 7
## 8777 -1333 -2963 3990 -41812 22578 10764
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -8.756e+04 1.701e+05 -0.515 0.658
## pop.weighted.NO2 3.978e+13 5.529e+13 0.719 0.547
## gdp.cap 2.374e-01 3.175e+00 0.075 0.947
## pop.density -2.936e+02 1.937e+02 -1.516 0.269
## med.age 3.341e+03 5.419e+03 0.617 0.600
##
## Residual standard error: 35200 on 2 degrees of freedom
## Multiple R-squared: 0.6837, Adjusted R-squared: 0.05123
## F-statistic: 1.081 on 4 and 2 DF, p-value: 0.5325

##
## Call:
## lm(formula = totcases.mil ~ pop.weighted.NO2 + gdp.cap + pop.density +
## med.age, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -4767.9 -1507.7 -37.8 1583.6 4521.5
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -2.951e+04 6.935e+03 -4.256 0.000691 ***
## pop.weighted.NO2 2.020e+12 1.301e+12 1.553 0.141312
## gdp.cap 1.025e+00 3.165e-01 3.238 0.005522 **
## pop.density -1.889e+01 9.928e+00 -1.902 0.076510 .
## med.age 1.489e+03 4.288e+02 3.473 0.003406 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 2855 on 15 degrees of freedom
## Multiple R-squared: 0.9242, Adjusted R-squared: 0.904
## F-statistic: 45.74 on 4 and 15 DF, p-value: 3.132e-08

##
## Call:
## lm(formula = totcases.mil ~ pop.weighted.NO2 + gdp.cap + pop.density +
## med.age, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -25681.6 -14474.6 134.7 14315.8 19752.8
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -5.628e+03 4.620e+04 -0.122 0.906
## pop.weighted.NO2 -5.335e+12 6.591e+12 -0.809 0.442
## gdp.cap 6.226e-01 4.211e-01 1.478 0.178
## pop.density 2.113e+02 1.430e+02 1.478 0.178
## med.age 7.712e+02 1.601e+03 0.482 0.643
##
## Residual standard error: 18510 on 8 degrees of freedom
## (1 observation deleted due to missingness)
## Multiple R-squared: 0.6966, Adjusted R-squared: 0.545
## F-statistic: 4.593 on 4 and 8 DF, p-value: 0.03207

##
## Call:
## lm(formula = totcases.mil ~ pop.weighted.NO2 + gdp.cap + pop.density +
## med.age, data = .)
##
## Residuals:
## ALL 5 residuals are 0: no residual degrees of freedom!
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -1.913e+05 NaN NaN NaN
## pop.weighted.NO2 2.886e+13 NaN NaN NaN
## gdp.cap 1.277e+01 NaN NaN NaN
## pop.density 3.630e+01 NaN NaN NaN
## med.age 8.563e+02 NaN NaN NaN
##
## Residual standard error: NaN on 0 degrees of freedom
## Multiple R-squared: 1, Adjusted R-squared: NaN
## F-statistic: NaN on 4 and 0 DF, p-value: NA

##
## Call:
## lm(formula = totcases.mil ~ pop.weighted.NO2 + gdp.cap + pop.density +
## med.age, data = .)
##
## Residuals:
## 1 3 4 5 6 7 8
## -208.35 2990.80 -2634.82 -50.89 919.46 969.02 -1985.22
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.754e+04 7.185e+03 2.442 0.1347
## pop.weighted.NO2 -7.075e+11 1.079e+12 -0.656 0.5793
## gdp.cap 1.171e+00 1.936e-01 6.046 0.0263 *
## pop.density 2.474e+01 1.226e+01 2.018 0.1811
## med.age -8.820e+02 3.031e+02 -2.910 0.1006
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 3291 on 2 degrees of freedom
## (1 observation deleted due to missingness)
## Multiple R-squared: 0.9516, Adjusted R-squared: 0.8547
## F-statistic: 9.825 on 4 and 2 DF, p-value: 0.09451

##
## Call:
## lm(formula = totcases.mil ~ pop.weighted.NO2 + gdp.cap + pop.density +
## med.age, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -36849 -21174 -4421 16219 92706
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -9.879e+04 4.657e+04 -2.121 0.0460 *
## pop.weighted.NO2 1.712e+12 7.678e+12 0.223 0.8257
## gdp.cap 5.295e-01 9.843e-01 0.538 0.5963
## pop.density 1.702e+02 1.817e+02 0.936 0.3597
## med.age 3.647e+03 1.409e+03 2.588 0.0172 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 31230 on 21 degrees of freedom
## Multiple R-squared: 0.4877, Adjusted R-squared: 0.3902
## F-statistic: 4.999 on 4 and 21 DF, p-value: 0.005452
deaths.NO2 <- function(x) {
high.NO2 %>%
filter(Super.region == x) %>%
ggplot(aes(x = pop.weighted.NO2, y = totdeaths.mil)) +
geom_point(color = "#333aff") +
geom_smooth(color = "red") +
geom_smooth(method = "lm", color = "purple") +
theme_bw() +
labs(x = "NO2 Concentration (mol/m^2)", y = "Total COVID-19 Deaths per Million People") +
labs(title = paste0("COVID-19 Deaths per Million People in ", (Super.region = x), " vs. Population Weighted NO2 Concentration"))
}
NO2.lm.deaths.reg <- function(x) {
high.NO2 %>%
filter(Super.region == x) %>%
lm(totdeaths.mil ~ pop.weighted.NO2 + gdp.cap + pop.density + med.age,.) %>%
summary.lm() #Function for linear regression statistics to be included in for loop below.
}
for (i in regions.list) {
print(deaths.NO2(i))
print(NO2.lm.deaths.reg(i))
} #Loops function for continents of interest.

##
## Call:
## lm(formula = totdeaths.mil ~ pop.weighted.NO2 + gdp.cap + pop.density +
## med.age, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1147.6 -548.2 172.5 397.8 1104.4
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.953e+03 1.528e+03 1.278 0.218
## pop.weighted.NO2 -1.882e+10 1.407e+11 -0.134 0.895
## gdp.cap -2.058e-02 1.407e-02 -1.463 0.161
## pop.density -4.122e-01 1.370e+00 -0.301 0.767
## med.age 4.735e+00 3.796e+01 0.125 0.902
##
## Residual standard error: 748.2 on 18 degrees of freedom
## Multiple R-squared: 0.1215, Adjusted R-squared: -0.0737
## F-statistic: 0.6225 on 4 and 18 DF, p-value: 0.6524

##
## Call:
## lm(formula = totdeaths.mil ~ pop.weighted.NO2 + gdp.cap + pop.density +
## med.age, data = .)
##
## Residuals:
## 1 2 3 4 5 6 7
## -151.18 26.53 45.48 27.39 191.80 -85.56 -54.45
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -2.247e+03 9.264e+02 -2.426 0.1361
## pop.weighted.NO2 6.239e+11 3.011e+11 2.072 0.1740
## gdp.cap -4.191e-02 1.729e-02 -2.424 0.1362
## pop.density -7.541e+00 1.055e+00 -7.149 0.0190 *
## med.age 1.381e+02 2.950e+01 4.681 0.0427 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 191.6 on 2 degrees of freedom
## Multiple R-squared: 0.9843, Adjusted R-squared: 0.9529
## F-statistic: 31.35 on 4 and 2 DF, p-value: 0.03115

##
## Call:
## lm(formula = totdeaths.mil ~ pop.weighted.NO2 + gdp.cap + pop.density +
## med.age, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -124.53 -77.71 -18.64 53.72 206.00
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -9.913e+02 2.544e+02 -3.896 0.00143 **
## pop.weighted.NO2 1.347e+11 4.773e+10 2.822 0.01287 *
## gdp.cap 1.269e-02 1.161e-02 1.093 0.29154
## pop.density -4.559e-01 3.643e-01 -1.252 0.22986
## med.age 4.312e+01 1.573e+01 2.741 0.01516 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 104.7 on 15 degrees of freedom
## Multiple R-squared: 0.8478, Adjusted R-squared: 0.8072
## F-statistic: 20.89 on 4 and 15 DF, p-value: 5.428e-06

##
## Call:
## lm(formula = totdeaths.mil ~ pop.weighted.NO2 + gdp.cap + pop.density +
## med.age, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -483.37 -148.69 2.96 168.01 431.23
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -1.381e+03 8.029e+02 -1.720 0.1238
## pop.weighted.NO2 9.745e+10 1.145e+11 0.851 0.4196
## gdp.cap -1.179e-02 7.317e-03 -1.612 0.1457
## pop.density -1.071e+00 2.484e+00 -0.431 0.6777
## med.age 6.608e+01 2.782e+01 2.375 0.0449 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 321.7 on 8 degrees of freedom
## (1 observation deleted due to missingness)
## Multiple R-squared: 0.5773, Adjusted R-squared: 0.366
## F-statistic: 2.732 on 4 and 8 DF, p-value: 0.1056

##
## Call:
## lm(formula = totdeaths.mil ~ pop.weighted.NO2 + gdp.cap + pop.density +
## med.age, data = .)
##
## Residuals:
## ALL 5 residuals are 0: no residual degrees of freedom!
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -2.317e+03 NaN NaN NaN
## pop.weighted.NO2 4.078e+11 NaN NaN NaN
## gdp.cap 1.846e-01 NaN NaN NaN
## pop.density 5.531e-01 NaN NaN NaN
## med.age -3.957e+00 NaN NaN NaN
##
## Residual standard error: NaN on 0 degrees of freedom
## Multiple R-squared: 1, Adjusted R-squared: NaN
## F-statistic: NaN on 4 and 0 DF, p-value: NA

##
## Call:
## lm(formula = totdeaths.mil ~ pop.weighted.NO2 + gdp.cap + pop.density +
## med.age, data = .)
##
## Residuals:
## 1 3 4 5 6 7 8
## 2.972 21.518 -18.880 -18.419 44.625 34.423 -66.239
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 2.044e+02 1.443e+02 1.416 0.292
## pop.weighted.NO2 -1.320e+09 2.166e+10 -0.061 0.957
## gdp.cap 8.808e-03 3.887e-03 2.266 0.152
## pop.density 4.856e-01 2.462e-01 1.973 0.187
## med.age -1.038e+01 6.085e+00 -1.707 0.230
##
## Residual standard error: 66.07 on 2 degrees of freedom
## (1 observation deleted due to missingness)
## Multiple R-squared: 0.8163, Adjusted R-squared: 0.4488
## F-statistic: 2.221 on 4 and 2 DF, p-value: 0.3337

##
## Call:
## lm(formula = totdeaths.mil ~ pop.weighted.NO2 + gdp.cap + pop.density +
## med.age, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1130.4 -334.2 -105.7 371.4 1277.9
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -3.218e+03 9.651e+02 -3.335 0.00314 **
## pop.weighted.NO2 -3.946e+10 1.591e+11 -0.248 0.80653
## gdp.cap -3.597e-03 2.040e-02 -0.176 0.86170
## pop.density 8.621e+00 3.766e+00 2.289 0.03253 *
## med.age 1.103e+02 2.920e+01 3.776 0.00111 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 647.1 on 21 degrees of freedom
## Multiple R-squared: 0.6097, Adjusted R-squared: 0.5353
## F-statistic: 8.201 on 4 and 21 DF, p-value: 0.0003795
#Low NO2.
#Weighted NO2 concentration vs COVID cases.
ggplot(data = low.NO2, aes(x = pop.weighted.NO2, y = totcases.mil)) +
geom_point(color = "#333aff", alpha = 1) +
geom_smooth(color = "red") +
geom_smooth(method = "lm", color = "purple") +
theme_bw() +
labs(x = "NO2 Concentration (mol/m^2)", y = "Total COVID-19 Cases per Million People") +
labs(title = "Low NO2: World COVID-19 Cases per Million vs. Population Weighted NO2 Concentration")

cor(low.NO2$totcases.mil, low.NO2$pop.weighted.NO2, use = "complete.obs")
## [1] -0.2481966
NO2.lm.cases <- lm(totcases.mil ~ pop.weighted.NO2 + gdp.cap + pop.density + med.age, data = low.NO2)
summary.lm(NO2.lm.cases)
##
## Call:
## lm(formula = totcases.mil ~ pop.weighted.NO2 + gdp.cap + pop.density +
## med.age, data = low.NO2)
##
## Residuals:
## Min 1Q Median 3Q Max
## -60523 -20064 -4987 8928 112401
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -1.291e+04 2.025e+04 -0.638 0.5258
## pop.weighted.NO2 -1.044e+13 7.915e+12 -1.319 0.1915
## gdp.cap 5.249e-01 2.840e-01 1.848 0.0688 .
## pop.density -8.377e+00 3.757e+00 -2.229 0.0290 *
## med.age 1.544e+03 7.454e+02 2.071 0.0420 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 33330 on 70 degrees of freedom
## (28 observations deleted due to missingness)
## Multiple R-squared: 0.2609, Adjusted R-squared: 0.2187
## F-statistic: 6.179 on 4 and 70 DF, p-value: 0.0002567
confint(NO2.lm.cases) #Summary statistics for linear fit.
## 2.5 % 97.5 %
## (Intercept) -5.329323e+04 2.747196e+04
## pop.weighted.NO2 -2.622701e+13 5.346650e+12
## gdp.cap -4.144120e-02 1.091225e+00
## pop.density -1.587006e+01 -8.828541e-01
## med.age 5.726653e+01 3.030386e+03
#Weighted NO2 concentration vs COVID deaths.
ggplot(data = low.NO2, aes(x = pop.weighted.NO2, y = totdeaths.mil)) +
geom_point(color = "#333aff", alpha = 1) +
geom_smooth(color = "red") +
geom_smooth(method = "lm", color = "purple") +
theme_bw() +
labs(x = "NO2 Concentration (mol/m^2)", y = "Total COVID-19 Deaths per Million People") +
labs(title = "Low NO2: World COVID-19 Deaths per Million vs. Population Weighted NO2 Concentration")

cor(low.NO2$totdeaths.mil, low.NO2$pop.weighted.NO2, use = "complete.obs")
## [1] -0.05342306
NO2.lm.deaths <- lm(totdeaths.mil ~ pop.weighted.NO2 + gdp.cap + pop.density + med.age, data = low.NO2,)
summary.lm(NO2.lm.deaths)
##
## Call:
## lm(formula = totdeaths.mil ~ pop.weighted.NO2 + gdp.cap + pop.density +
## med.age, data = low.NO2)
##
## Residuals:
## Min 1Q Median 3Q Max
## -891.0 -291.1 -188.1 144.6 5226.9
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -6.863e+02 5.077e+02 -1.352 0.1810
## pop.weighted.NO2 1.463e+11 2.016e+11 0.726 0.4706
## gdp.cap -4.316e-03 6.705e-03 -0.644 0.5219
## pop.density -1.054e-01 8.888e-02 -1.185 0.2401
## med.age 4.159e+01 1.793e+01 2.320 0.0234 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 786.4 on 66 degrees of freedom
## (32 observations deleted due to missingness)
## Multiple R-squared: 0.09652, Adjusted R-squared: 0.04177
## F-statistic: 1.763 on 4 and 66 DF, p-value: 0.1469
confint(NO2.lm.deaths) #Summary statistics for linear fit.
## 2.5 % 97.5 %
## (Intercept) -1.700003e+03 3.273119e+02
## pop.weighted.NO2 -2.562264e+11 5.488689e+11
## gdp.cap -1.770292e-02 9.070129e-03
## pop.density -2.828289e-01 7.209605e-02
## med.age 5.796624e+00 7.738380e+01